attribute blah has no value
HI all, I'm trying to use a dynamic value for an attribute of my tag. but I'm gettin this error: org.apache.jasper.compiler.ParseException: D:\jakarta-tomcat-3.2.1\webapps\mycompany\test.jsp(6,46) Attribute users has no value at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:499) Here's my tag entry in my tld file hi.tld hello mycompany.HelloTag JSP foo true true mycompany.HelloTag simply calls out.print(foo) Here's the JSP that generates the error. " /> users doesn't actually exist in the request but it should just return null right ? so when I change my jsp to this: <% String bar = request.getParameter("users"); %> it prints out "null" and works just fine. Any suggestions ? Thanx
Re: attribute blah has no value
yea, that works great. I should've known better. Thanx At 02:24 PM 2/21/2001 -0800, you wrote: >You are trying to use nested double quotes, which is probably confusing the >parser somewhat. Try this instead: > > > >Hope this helps. > >-- >Martin Cooper >Tumbleweed Communications > > >- Original Message - >From: "Justin Kennedy" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Wednesday, February 21, 2001 2:13 PM >Subject: attribute blah has no value > > > > HI all, > > > > I'm trying to use a dynamic value for an attribute of my tag. but I'm > > gettin this error: > > org.apache.jasper.compiler.ParseException: > > D:\jakarta-tomcat-3.2.1\webapps\mycompany\test.jsp(6,46) Attribute users > > has no value at > > >org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:499) > > > > > > Here's my tag entry in my tld file > > > > hi.tld > > > > > > hello > > mycompany.HelloTag > > JSP > > > > foo > > true > > true > > > > > > > > mycompany.HelloTag simply calls out.print(foo) > > > > Here's the JSP that generates the error. > > " /> > > > > users doesn't actually exist in the request but it should just return null > > right ? > > so when I change my jsp to this: > > <% > > String bar = request.getParameter("users"); > > %> > > > > > > it prints out "null" and works just fine. > > > > Any suggestions ? > > Thanx > > Justin Kennedy Computer Systems Analyst Consortio, Inc. www.consortio.com
RE: missing resource attribute
Have you included an 'application' element in web.xml, which points to your ApplicationResources.properties file ? application your.path.ApplicationResources take a look at web.xml in the struts-example app -Justin -Original Message- From: Ratnadeep Bhattacharjee [mailto:[EMAIL PROTECTED]] Sent: Monday, February 05, 2001 11:49 AM To: [EMAIL PROTECTED] Subject: missing resource attribute Hello All, Just wondering if anybody has encountered this problem. Any help/pointers would be really appreciated. Thanks, -Deep. When I include the following tag in my jsp: I get the following error: Error: 500 Location: /struts-myexample/logon.jsp Internal Servlet Error: javax.servlet.ServletException: Missing resources attribute org.apache.struts.action.MESSAGE at java.lang.Throwable.fillInStackTrace(Native Method) at java.lang.Throwable.fillInStackTrace(Compiled Code) at java.lang.Throwable.(Compiled Code) at java.lang.Exception.(Compiled Code) at javax.servlet.ServletException.(ServletException.java:161) Root cause: javax.servlet.jsp.JspException: Missing resources attribute org.apache.struts.action.MESSAGE at java.lang.Throwable.fillInStackTrace(Native Method) at java.lang.Throwable.fillInStackTrace(Compiled Code) at java.lang.Throwable.(Compiled Code) at java.lang.Exception.(Compiled Code) at javax.servlet.jsp.JspException.(JspException.java:73) I have ensured that the logon.title=someValue exists in my ApplicationResource.properties file > To: [EMAIL PROTECTED] > Subject: no mapping available error > Content-Transfer-Encoding: 7bit > X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N > > I am getting a "no mapping available" error whenever I use the > struts 1.0 example application in Servlet Mill. There seems to > be a problem reading the struts-config.xml file, because Struts .5 > examples > using action work fine. Can anyone help? > > Julia Reynolds >
my forms are not auto-repopulating
Hi all, I have 5 text fields in my logon.jsp and all are required, so when I fill out only four, my LogonForm.validate() fails and returns to logon.jsp with all form fields empty. It works for the struts-example, and I more of less copied what was being done there. I notice it does work if I change the scope to 'session', but I don't want to do this. I'm using the latest nightly, but it was working for 0.5 if that will yield any clues. here's what the entry looks like in my struts-config.xml: thanx -Justin
Problems running struts-example
I grabbed the latest nightly build, dropped struts-example.war in the webapps dir, but when I try to run it I get this error: Missing message for key index.title ... javax.servlet.jsp.JspException: Missing message for key index.title at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:261) ... I noticed quite a few threads on this, but most pertaining to the Orion server but I'm using Tomcat. The properties file it is looking for in web.xml does exist, and there is indeed an entry for index.title. Everything else works fine.. my struts application/struts-documentation/etc.. any suggestions ? thanx -Justin
using
Hi all I've created a form like so: which contains a select box named 'username' I want to provide a link which will post the form. I've created UsersForm.java to validate, and it returns an error if username isn't selected. Everything works fine with: But I want to accomplish this with: Add User When I click on this link, it comes back to the same page with the error message I provided in UsersForm.validate() of "you must select a username", even though I've selected a username. So, by specifying users.do for page in
RE: How to build the struts-example?
First off let me suggest to you to download the latest nightly build and start from there. Porting from 0.5 to 1.0 is a real headache. If you do this, remember that action.xml is depreciated in 1.0 use struts-config.xml instead. About your problem. At first glance, it seems that you are pointing ANT_HOME, ANT_OPTS, SERVLETAPI_HOME to TOMCAT_HOME. but they should be set to thier corresponding installation directory. If you want to build you will need the source code version instead of the binary version won't you ? read this installation instructions more closely, and you should be all set. http://jakarta.apache.org/struts/installation.html -Justin -Original Message- From: Ratnadeep Bhattacharjee [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 01, 2001 4:16 PM To: [EMAIL PROTECTED] Subject: How to build the struts-example? Hello all. I am very new to Struts. I have downloaded the binary version of Struts 0.5 from the web and read thru the docs and also ran the examples. I was interested in building the example application instead of copying the WAR file to the webapps directory of jakarta-tomcat. I am not nure how to go about building it though. I tried to run the build.sh in etc/ but it doesn't seem to find the classes. I have changed the *_HOME in build.sh as follows: # - Verify and Set Required Environment Variables - ANT_HOME=${TOMCAT_HOME} ANT_OPTS=${TOMCAT_HOME} SERVLETAPI_HOME=${TOMCAT_HOME} TOMCAT_HOME=${TOMCAT_HOME} where TOMCAT_HOME is the root of my jakarta-tomcat installation. I get the following error whenever I run build.sh: Exception in thread "main" java.lang.NoClassDefFoundError: jakarta-tomcat-3/2/1 My jakarta tomcat installation root is jakarta-tomcat-3.2.1 Any help would be really appreciated. Thanks, -Deep.
using
Hi all I've created a form like so: which contains a select box named 'username' I want to provide a link which will post the form. I've created UsersForm.java to validate, and it returns an error if username isn't selected. Everything works fine with: But I want to accomplish this with: Add User When I click on this link, it comes back to the same page with the error message I provided in UsersForm.validate() of "you must select a username", even though I've selected a username. So, by specifying users.do for page in
RE: RePost: Retreiving multiple values from SELECT boxes
http://www.mail-archive.com/struts-user@jakarta.apache.org -Justin -Original Message- From: Vijay [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 01, 2001 11:08 AM To: [EMAIL PROTECTED] Subject: Re: RePost: Retreiving multiple values from SELECT boxes Could any one tell me the mail archive URL? http://archive.covalent.net/jakarta/struts-user/2001/01/date.xml seems to be outdated thanx, vijay
Missing message for key index.title
I grabbed the latest nightly build, recompiled struts, dropped struts-example.war in the webapps dir, but when I try to run it I get the above error. I noticed quite a few threads on this, but most pertaining to the Orion server. I'm using Tomcat. Everything was working with my 0.5 tree, but I decided to upgrade and here I am. The properties file it is looking for in web.xml does exist, and there is indeed an entry for index.title. any suggestions ? Root cause: javax.servlet.jsp.JspException: Missing message for key index.title at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:261) thanx -Justin
RE: suggestion for searchable list archive..
Is this what your talking about ? http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Justin -Original Message- From: Joerg Beekmann [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 30, 2001 11:04 AM To: [EMAIL PROTECTED] Subject: RE: suggestion for searchable list archive.. For what it's worth think this is a great idea and applies equally to the other Jakarta lists. Joerg > -Original Message- > From: Anand Raman [mailto:[EMAIL PROTECTED]] > Sent: January 30, 2001 10:11 AM > To: struts > Subject: suggestion for searchable list archive.. > > > Hi guys > This list badly needs a searchable archive. > > I suggest that we submit this list to site like geocrawler which will > silently index all the mails on this list.. > > However geocrawler needs premission from the list admin before going > ahead. Will the list admin please authorize such a submission > > Thanks > Anand Raman
RE: JSP probleme - ms windows specific
If you really really think it's a case problem, go to a dos window and check out the offending directory. dos won't hide the case from you. -Original Message- From: Frederic BAGES [mailto:[EMAIL PROTECTED]] Sent: Monday, January 29, 2001 9:49 AM To: [EMAIL PROTECTED] Subject: RE: JSP probleme Thank you Steven for your remarks. I had checked all of these before sending my first mail but it was not any of these. I've tried anything i had in mind and now it's working. I don't really know why but i think it can be a case (not all in uppercase ?) problem on the WEB-INF directory (I'm using a Win.. named OS that don't show the case in the file explorer). You also said that struts 1.0 is comming soon but do you think it can be considered as an error-less version ? (i.e. can I use it on a production server ?) Frederic -Message d'origine- De : Steven D. Wilkinson [mailto:[EMAIL PROTECTED]] Envoyé : lundi 29 janvier 2001 18:38 À : [EMAIL PROTECTED] Objet : Re: JSP probleme Which version of struts are you using? Note my answer is how you do it in struts 1.0 (actually form the 01-28-2001 source download) I'm not sure how to do it in 0.5. If you are just starting and trying to use 0.5, I suggest you start with one of the nightly source distributions because 1.0 should be released shortly. Just some bug fixes and documentation updates as I hear on the mail lists. That said The tag library descriptors must be in your WEB-INF and registered in your web.xml and you must reference them properly in the JSP page. /webapps/animation/WEB-INF/struts-bean.tld struts-html.tld struts-logic.tld struts-template.tld struts.tld In your web.xml http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> .. other stuff here Note, refer to DTD about location of taglib. it's at the bottom if you are not using any ejb stuff. /WEB-INF/struts-bean.tld /WEB-INF/struts-bean.tld /WEB-INF/struts-html.tld /WEB-INF/struts-html.tld /WEB-INF/struts-logic.tld /WEB-INF/struts-logic.tld You only need to enter the ones that you are using. This is from the struts-example/WEB-INF/web.xml file. Then in you JSP page put this... <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> Note, the file in the uri determines the name and location of the tlds. The prefix is upto you. Good luck, Steve Frederic BAGES wrote: > > Hi all, i'm new to Struts and i have i problem that seems to concern Tomcat > and Struts. > > I've installed Strut and the two exemples WAR files under tomcat 3.2. the > exemples are just running fine but when i try to run my own jsp file i have > an error from the jsp compiler. > > org.apache.jasper.compiler.CompileException: > C:\jakarta-tomcat-3.2.1\webapps\animation\logon.jsp(1,0) Unable to open > taglibrary /WEB-INF/struts.tld : Could not locate TLD META-INF/taglib.tld > at > org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEve > ntListener.java, Compiled Code) > at > org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingList > ener.java:116) > at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java, Compiled > Code) > at org.apache.jasper.compiler.Parser.parse(Parser.java, Compiled Code) > at org.apache.jasper.compiler.Parser.parse(Parser.java:1042) > at org.apache.jasper.compiler.Parser.parse(Parser.java:1038) > at org.apache.jasper.compiler.Compiler.compile(Compiler.java, Compiled > Code) > at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462) > . > > My JSP file and the corresponding classes (LogonForm and LogonAction) are > just copies of the examples with some little changes. > > Does anyone could help me ? > > Thanks. > > Frederic. > > The JSP file is following : > > <%@ page language="java" %> > <%@ taglib uri="/WEB-INF/struts.tld" prefix="struts" %> > > > > Titletitle> > > > > > > type="com.infusio.gamezilla.portal.LogonForm"> > > > > > User name : > > > > > > > > > Password : > > > > > > > > > > > > > > > > > > > > >
RE: localization
Thanks for the input Scott. I did what you initially said and it works fine. Basically, the "Administrator" of this application will choose the locale he wants to use before "Adding new data". Picture an Admin app where Shipping carriers and services have to be entered into the system for each language where it will be used. First the administrator will select french locale and then enter a french description for the service "Federal Express overnight". Then the administrator switches to spanish to do the same thing. But the content of the page itself, aside from the form data, will be in the language local to the administrator. My companies "database framework" takes care of storing/retrieving the data using a Locale object. I'm not sure at this point how it's all going to tie together, but I currently have it working for straight up JSP. This all may sound a little off from my original question, so I'll apologize in advance. Thanks again -Original Message- From: Scott Sayles [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 5:15 PM To: [EMAIL PROTECTED] Subject: RE: localization Just as an after thought, if you intend on displaying multiple languages within a page, one way to handle this could be to instantiate seperate resource bundles with each using a different locale and then make these available as application or session scope objects. It would be fairly easy to implement some custom tags for doing the generic resourcebundle.getString("key") calls for the particular locale. Although I'm not sure, I think there is some way to specify additional "MessageResource"s with Struts (?). Anybody have any additional ideas or insights? Thanks. Scott > -Original Message- > From: Scott Sayles [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 25, 2001 6:58 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: localization > > > > <% > > java.util.Locale locale = new java.util.Locale("fr", "CA"); > > session.setAttribute("localeKey", locale); > > %> > > There is probably a way to handle this within the existing Struts API, but > in reference to this particular mechanism your attempting... > > The "localeKey" should actually be set to > org.apache.struts.action.Action.LOCALE_KEY. > i.e. > <% > session.setAttribute(Action.LOCALE_KEY, locale); > %> > > It's unfortunate that the provided java.util.Locale object is > (for the most > part) immuttable. Although, it would probably be fairly easy to extend it > to allow setting the country and lanuage on the fly. > > Hope this helps. > > Scott > > > > -Original Message- > > From: Justin Kennedy [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 25, 2001 6:25 PM > > To: [EMAIL PROTECTED] > > Subject: localization > > > > > > Hi all, > > > > I'm creating an administrative web application using struts. The > > application > > needs to change locales in different parts of the same page. I'm having > > trouble accomplishing this. > > > > I'm using struts 0.5 with tomcat 3.2.1 and jdk 1.3 > > > > I have three files in my > > $TOMCAT_HOME/webapps/hello-world/WEB-INF/classes/helloworld/ directory > > named: > > HelloWorldResources.properties > > HelloWorldResources_fr.properties > > HelloWorldResources_fr_CA.properties > > > > with > > hello.message=Hello > > in HelloWorldResources.properties > > > > hello.message=Bonjour > > in both HelloWorldResources_fr.properties and > > HelloWorldResources_fr_CA.properties > > > > by looking at the message tag in struts.tld I noticed the 'locale' > > attribute. So first I tried this: > > > > > > Instead of getting back Bonjour I got Hello > > > > so then I tried: > > > > > > with the same results. > > > > then I decided to investigate MessageTag.java and found some > references to > > localeKey and mentioning that this was a session attribute. > > So then I tried: > > <% > > java.util.Locale locale = new java.util.Locale("fr", "CA"); > > session.setAttribute("localeKey", locale); > > %> > > > > > > but got the same results (hello instead of bonjour) > > > > I also tried the same thing above but with the message > attribute locale of > > "fr_CA" passed, but no go. > > > > What am I doing wrong ? This is my first crack at struts. > > > > Thanks, > > -Justin > > > > > >
localization
Hi all, I'm creating an administrative web application using struts. The application needs to change locales in different parts of the same page. I'm having trouble accomplishing this. I'm using struts 0.5 with tomcat 3.2.1 and jdk 1.3 I have three files in my $TOMCAT_HOME/webapps/hello-world/WEB-INF/classes/helloworld/ directory named: HelloWorldResources.properties HelloWorldResources_fr.properties HelloWorldResources_fr_CA.properties with hello.message=Hello in HelloWorldResources.properties hello.message=Bonjour in both HelloWorldResources_fr.properties and HelloWorldResources_fr_CA.properties by looking at the message tag in struts.tld I noticed the 'locale' attribute. So first I tried this: Instead of getting back Bonjour I got Hello so then I tried: with the same results. then I decided to investigate MessageTag.java and found some references to localeKey and mentioning that this was a session attribute. So then I tried: <% java.util.Locale locale = new java.util.Locale("fr", "CA"); session.setAttribute("localeKey", locale); %> but got the same results (hello instead of bonjour) I also tried the same thing above but with the message attribute locale of "fr_CA" passed, but no go. What am I doing wrong ? This is my first crack at struts. Thanks, -Justin