RE: query string parameters problem
The scope of the ActionForm is session means that the last submitted ActionForm will remain in the session till the session ends. In you case, even though the ActionForm is getting populated with the values for the first time, those are getting overridden by the second request and the second request is not taking the values of name and age in the query string (As the querystring URL is getting overridden by "/submit.do"). Regards, Rajasekhar Cherukuri "R.Vijayaraghavan" <[EMAIL PROTECTED]> 10/22/2005 12:14 PM Please respond to "Struts Users Mailing List" To "Struts Users Mailing List" cc Subject RE: query string parameters problem > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Saturday, October 22, 2005 12:08 PM > To: Struts Users Mailing List > Subject: RE: query string parameters problem > > > > Are you able to see the 'age' and 'name' attributes in the address bar > after submitting the form ? If not, the action="/submit.do" in your > is overwriting the URL you wanted to post. IN this case you > can use the hidden variables for age and name and set the required values > in the Javascript. Yes it overwrites the address bar with just /submit.do. But why should the name and age attributes be null when the ActionForm is in session scope. Shouldn't the values be re-used. > > Regards, > Rajasekhar Cherukuri > regards, vijay. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ForwardSourceID:NT674A Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
RE: query string parameters problem
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Saturday, October 22, 2005 12:08 PM > To: Struts Users Mailing List > Subject: RE: query string parameters problem > > > > Are you able to see the 'age' and 'name' attributes in the address bar > after submitting the form ? If not, the action="/submit.do" in your > is overwriting the URL you wanted to post. IN this case you > can use the hidden variables for age and name and set the required values > in the Javascript. Yes it overwrites the address bar with just /submit.do. But why should the name and age attributes be null when the ActionForm is in session scope. Shouldn't the values be re-used. > > Regards, > Rajasekhar Cherukuri > regards, vijay. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: query string parameters problem
struts-config.xml ActionForm has the setter and getter methods for name, age and description. Action: public final class QueryParamsAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form1, HttpServletRequest request, HttpServletResponse response) throws Exception { QueryParamsForm form = (QueryParamsForm)form1; //String name = (String) PropertyUtils.getSimpleProperty(form, "name"); String name = (String) request.getParameter("name"); //String age = (String) PropertyUtils.getSimpleProperty(form, "age"); String age = (String) request.getParameter("age"); String description = (String) PropertyUtils.getSimpleProperty(form, "description"); out.println(name); out.println(age); out.println(description); return (mapping.findForward("nextPage")); } My initial query string is: http://localhost:8080/vijay/QueryParams.do?name=vijay&age=26 This instantiates the ActionForm, sets age and name, comes to teh Action, print age and name correctly, prints description as null(as expected), goes to "nextPage" whcih is QueryParams.jsp. In QueryParams.jsp, I print name, age and assign a textbox for the atribute 'description' which when submitted should set description in the ActionForm. It does so. When it comes back to Action, description gets printed but name and age are now null. > It should work the way you want (session scoped forms retain > their values.) > > Post the relevant parts of struts-config (the form bean and action) > and the part of the Action code where you're trying to access the form > properties, and see if someone can spot a problem. Also describe > the flow > of your app. > > My guess is that you're dealing with two different form beans, > but I need to > see the config file. > > -- > Wendy Smoak > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: query string parameters problem
Are you able to see the 'age' and 'name' attributes in the address bar after submitting the form ? If not, the action="/submit.do" in your is overwriting the URL you wanted to post. IN this case you can use the hidden variables for age and name and set the required values in the Javascript. Regards, Rajasekhar Cherukuri "R.Vijayaraghavan" <[EMAIL PROTECTED]> 10/22/2005 11:53 AM Please respond to "Struts Users Mailing List" To "Struts Users Mailing List" cc Subject RE: query string parameters problem > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Saturday, October 22, 2005 8:36 AM > To: Struts Users Mailing List > Subject: Re: query string parameters problem > > > > Hi, > You should use > request.getParameter("name") > request.getParameter("age") It does not work. > to get the values from the request. I don't think the values set > through through query string will be set to ActionForm automatically. In > this case you should explicitly call the setter methods of the ActionForm > and then set the new ActionForm object to session with the same name that > was used in the action element attribute "attribute" in struts-config.xml. No, the values are set even while passing the values through the query string. Why should not this work. The URL with the query string will call teh appropriate ActionForm, set the values that it gets from the Http GET request. The problem I face is that when I submit the html page, the name and age do not get added to the query string(and thats fine, it should not). The description goes via the Http POST request, ActionForm sets the value of description, comes to the Action. Its here that I am not able to get the values of name and age. regards, vijay. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ForwardSourceID:NT6736 Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
Re: query string parameters problem
From: "R.Vijayaraghavan" <[EMAIL PROTECTED]> The action is set to /submit.do. Since I am only sending the description in the http request, only the setDescription() method should be called and it happens so. The problem is when I try to access the age and name variables from the ActionForm in the Action class, I get null. Why so? I am not setting age and name after submitting the form, they are already set. The form is in session scope, so shouldn't it be re-used. It should work the way you want (session scoped forms retain their values.) Post the relevant parts of struts-config (the form bean and action) and the part of the Action code where you're trying to access the form properties, and see if someone can spot a problem. Also describe the flow of your app. My guess is that you're dealing with two different form beans, but I need to see the config file. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: query string parameters problem
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Saturday, October 22, 2005 8:36 AM > To: Struts Users Mailing List > Subject: Re: query string parameters problem > > > > Hi, > You should use > request.getParameter("name") > request.getParameter("age") It does not work. > to get the values from the request. I don't think the values set > through through query string will be set to ActionForm automatically. In > this case you should explicitly call the setter methods of the ActionForm > and then set the new ActionForm object to session with the same name that > was used in the action element attribute "attribute" in struts-config.xml. No, the values are set even while passing the values through the query string. Why should not this work. The URL with the query string will call teh appropriate ActionForm, set the values that it gets from the Http GET request. The problem I face is that when I submit the html page, the name and age do not get added to the query string(and thats fine, it should not). The description goes via the Http POST request, ActionForm sets the value of description, comes to the Action. Its here that I am not able to get the values of name and age. regards, vijay. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: query string parameters problem
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Sent: Friday, October 21, 2005 7:01 PM > To: user@struts.apache.org > Subject: RE: query string parameters problem > > > R.Vijayaraghavan asked: > [snip] > > The action is set to /submit.do. Since I am only sending the > > description in the http request, only the setDescription() > > method should be called and it happens so. The problem is > > when I try to access the age and name variables from the > > ActionForm in the Action class, I get null. Why so? I am not > > setting age and name after submitting the form, they are > > already set. The form is in session scope, so shouldn't it be re-used. > > You might want to add hidden fields in your HTML form so that the name > and age get resubmitted. This can be done. > Or, if the data you want is already in session > scope, have your Action read that data from there. When I say that the form is in session scope, does it mean that the attributes in the form bean will hold their values until modified. If yes, then why in my case it does not work. regards, vijay. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
sharing message resources with jstl
I have three message resources defined in struts-config.xml: In web.xml, I define a context parameter as follows, javax.servlet.jsp.jstl.fmt.localizationContext ApplicationMessageResources Questions: (1). Can I define more than message resources in context param? (2). In jsp, how do I access these three message resources? I am using JBoss 4.1 and Struts 1.2.4. _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to display an error image next to an invalid form field?
Wendy Smoak wrote: From: "Mon Cab" <[EMAIL PROTECTED]> I know will give me the error message for username, but I don't care about that. I just want to display the error arrow. Wrap the arrow in using the same 'property' attribute. http://struts.apache.org/struts-taglib/tagreference-struts-logic.html#messagesPresent Or use the errorStyle... attributes and insert the image with CSS (note, I haven't tried using the errorStyle{,Id,Class} attributes yet, but they should be perfect for this). L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: query string parameters problem
Hi, You should use request.getParameter("name") request.getParameter("age") to get the values from the request. I don't think the values set through through query string will be set to ActionForm automatically. In this case you should explicitly call the setter methods of the ActionForm and then set the new ActionForm object to session with the same name that was used in the action element attribute "attribute" in struts-config.xml. Regards, Rajasekhar Cherukuri "R.Vijayaraghavan" <[EMAIL PROTECTED]> 10/21/2005 03:40 PM Please respond to "Struts Users Mailing List" To "Struts Users Mailing List" cc Subject query string parameters problem Hello, I have 3 variables, namely age, name and description. I have the values for name and age before sending the request. That is, my URL would look like http://localhost:8080/vijay/submit.do?name=xyz&age=22 I have a form that sets the values of age and name which is then accessed in a html page using bean:write. In the html page, the user will enter the description in the corrosponding textarea. The action is set to /submit.do. Since I am only sending the description in the http request, only the setDescription() method should be called and it happens so. The problem is when I try to access the age and name variables from the ActionForm in the Action class, I get null. Why so? I am not setting age and name after submitting the form, they are already set. The form is in session scope, so shouldn't it be re-used. Or am I understanding it in-correctly. regards, vijay. Sorry if the subject of the mail is not proper, I couldn't think of any other subject. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ForwardSourceID:NT66BE Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
Re: Socket exception - please help
On 10/13/05, Murray Collingwood <[EMAIL PROTECTED]> wrote: > Hi > > I have an action class that serves us images from my application. The java > class is > fairly simple and mostly copied from (our friend) the wiki: ... > However when this class runs I get the following exception: > NotifyUtil::java.net.SocketException: Software caused connection abort: recv > failed > at java.net.SocketInputStream.socketRead0(Native Method) Don't worry, it's "normal", especially if you are browsing with Internet Explorer. In an application I wrote that served TIFF files I had the same problem initially, until I started catching and ignoring this particular exception; with Mozilla the exceptions simply did not appear. I believe this is a side-effect of the dumb way that IE uses to figure out the content type of the stream it receives, even when the server specifies it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to display an error image next to an invalid form field?
From: "Mon Cab" <[EMAIL PROTECTED]> I know will give me the error message for username, but I don't care about that. I just want to display the error arrow. Wrap the arrow in using the same 'property' attribute. http://struts.apache.org/struts-taglib/tagreference-struts-logic.html#messagesPresent HTH, -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to display an error image next to an invalid form field?
Lauri I want to do this: Forgive the "pseudo"-tags. I don't know if there are struts tags in to do this... I know will give me the error message for username, but I don't care about that. I just want to display the error arrow. Do you know how this would be done? --- Laurie Harper <[EMAIL PROTECTED]> wrote: > Mon Cab wrote: > >>I have read the struts documentation and am trying > >>to > >>work out how I would display an error image next > to > >>an > >>invalid form field. > >> > >>Ramesh mentioned that >>property="custName"/> would display the error > >>message > >>associated with a particular field. Is there a > (set > >>of) struts tag(s) that would test whether a form > >>field > >>were invalid? (Maybe a combination of html and > logic > >>tags). > >> > >>I would like to do this without implementing any > >>ActionForms. Ideally I would like to specify > >>DynaValidatorForms in the struts-config file, and > >>specify field validations for those forms in the > >>validation.xml file. > >> > >>I am presuming that the struts framework would > then > >>generate a DynaValidatorForm object after the html > >>form were submitted. I am also presuming that > this > >>would automatically populate the so > >>that > >>I could print the errors in my page, and I could > >>print > >>individual errors using >>property="formfield">. (Is this correct ??) > > More or less, yes. > > >>Is there a way of using struts tags to test for > the > >>validity of a specific form field. How would this > >>be > >>written? If not, what are the work arounds? > > I'm not sure I understand what you want to do. You > don't need to use any > tags to test whether form fields contain valid data; > Struts will do that > for you based on your validator rules, as you > describe above. The > tag will then take care of figuring > out whether there's > anything to display automatically. > > L. > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forcing JSP reloading, avoiding IE caching of it
I ran into a related problem recently that could be worked around by switching the "Check for newer versions of stored pages" setting in IE from "Every visit to the page" to "Automatic". As described here: http://www.microsoft.com/windows/ie/using/howto/customizing/clearcache.mspx However that's not much good if you have a website and don't want to force users to change settings. Or require users to use a real browser. ;-) I'd be interested to see if there are programming related solutions. Brady > Hello all, > > I have a struts app that works great on Firefox, however when I use IE I > have problems with it. > I guess that IE caches the JSP page. So when the action sends the data > to the JSP I always have the same > thing. > > So I read about it and found that if you add on the struts-config.xml > it would > solve the issue. Well it does not solve it in its entirely. > > I would like to ask if I could have something on the JSP or the HTML > part of it to force reloading by IE. > Any suggestions? > > Thanks, > > C.F. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forcing JSP reloading, avoiding IE caching of it
You can't really force the browser to do anything, but you can hint it with the following: http://www.jguru.com/faq/view.jsp?EID=377 best of luck, On 10/21/05, C.F. Scheidecker Antunes <[EMAIL PROTECTED]> wrote: > Hello all, > > I have a struts app that works great on Firefox, however when I use IE I > have problems with it. > I guess that IE caches the JSP page. So when the action sends the data > to the JSP I always have the same > thing. > > So I read about it and found that if you add on the struts-config.xml > it would > solve the issue. Well it does not solve it in its entirely. > > I would like to ask if I could have something on the JSP or the HTML > part of it to force reloading by IE. > Any suggestions? > > Thanks, > > C.F. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[FRIDAY] Re: i18n and same value for 2 different locale
Christian Bourque wrote: [...]the value returned was in english for a french locale ??? We know how much the French love speaking English. It's part of our plan for total world domination, one server at a time. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
i18n and same value for 2 different locale
Hi! I got a weird problem with my application (only in production), the problem is intermittent and I wasn't able to reproduce it yet. Sometimes the messages returned by bean:message aren't correct (english when it should be french and vice versa). I did a test in a jsp for a specific key and the value returned was in english for a french locale ??? What is weird is that it doesn't apply to all messages on the page, some messages are in french and the others in english ??? It's like at some point the Struts messages cache got corrupted... I have two properties file : - application.properties (default french) - application_en.properties (english) A default locale is set in my init servlet : Locale.setDefault(Locale.FRENCH); I never experienced the same behaviour on my development workstation (XP), the production server runs Linux (SUSE)... I reloaded the properties files live on the production with this code in a jsp (ugly hack) : MessageResourcesFactory factory =MessageResourcesFactory.createFactory(); MessageResources resources =factory.createResources("resources.application"); application.setAttribute("org.apache.struts.action.MESSAGE", resources); And everything went back to normal (until next time)... I would appreciate any suggestions! Regards, Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Forcing JSP reloading, avoiding IE caching of it
Hello all, I have a struts app that works great on Firefox, however when I use IE I have problems with it. I guess that IE caches the JSP page. So when the action sends the data to the JSP I always have the same thing. So I read about it and found that if you add on the struts-config.xml it would solve the issue. Well it does not solve it in its entirely. I would like to ask if I could have something on the JSP or the HTML part of it to force reloading by IE. Any suggestions? Thanks, C.F. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: issue with on JDK 1.4.2
Laurie, Thanks for your reply.I'm not sure if I understand you clearly.I have used bean:define inside the logic:present tag as seen in the code snippet.This is supposed to define a scripting variable named by the "id" attribute as described in the Struts docs: "Create a new attribute (in the scope specified by the toScope property, if any), and a corresponding scripting variable, both of which are named by the value of the id attribute" http://struts.apache.org/struts-taglib/tagreference-struts-bean.html The issue I have is that the scripting variable "userRequest" is not created by the bean:define tag inside the logic:present tag. Instead "userRequest" is created as a pageContext attribute. So, if I use the scriptlet below to access the pageContext attributes, my code works: - <% dsap.business.UserRequest userRequest = (dsap.business.UserRequest)pageContext.getAttribute("userRequest"); %> <% dsap.business.Employee employee = (dsap.business.Employee)pageContext.getAttribute("employee"); %> -- Anyway, the same code (bean:define embedded inside logic tags) used to work perfectly with the previous version of my server (JSP 1.1).So, I'm puzzled why it doesn't work with the latest version of my server - OC4J 9.0.4 (JSP 1.2). Could this be some JSP 1.1 - 1.2 compatibility issue? Shyam --- Laurie Harper <[EMAIL PROTECTED]> wrote: > You're checking whether userRequest exists as a > session attribute, then > trying to access it as a scripting variable. The one > doesn't imply you > can do the other. If you need to access userRequest > from scriptlets, > you'll need to use to create the > scripting variable or > lookup the bean in the session in your scriptlet: > > > <%=session.getAttribute("userRequest").getReqType()%> > > L. > > Shyam Anand wrote: > > I figured that it's not a JDK issue and it is an > > application server issue. I use OC4J (Oracle IAS) > and > > I'm upgrading from a version that supports JSP 1.1 > to > > the one that is certified for JSP 1.2. > > So, could this be a JSP 1.1 - 1.2 compatibility > issue? > > > > The JSP Compiler of the OC4J container doesn't > seem to > > recognize the bean:define tags embedded inside > Struts > > logic tags. > > > > See JSP code snippet below: > > > > > > > > > scope="session" type="dsap.business.UserRequest"/> > > > property="employee" type="dsap.business.Employee" > /> > > name="userRequest" > > property="userModuleList" /> > > > > > > > > And I get an error message when I access the > > "userRequest" bean's properties in my JSP: > > > > eg. > > > value="<%=userRequest.getReqType()%>" /> > > > > Error: > > JspServlet: unable to dispatch to requested page: > > oracle.jsp.provider.JspCompileException: Errors > > compiling:[jsp src:line #:133] cannot resolve > symbol: > > variable userRequest > > > > Any idea on what could be wrong here? Is there any > > workaround for this? > > > > I would not want to use JSTL as I have some time > > constraints. > > > > Any help will be greatly appreciated. > > > > Thanks, > > Shyam > > > > > > --- Dave Newton <[EMAIL PROTECTED]> wrote: > > > > > >>Shyam Anand wrote: > >> > >> > >>>I have issues with struts-logic tags...I'm not > >> > >>using JSTL. > >> > >>> > >>> > >> > >>Whoops. > >> > >>I'm running 1.4.2 w/o any struts tag issues > >>(including 'logic'). > >>(Tomcat, WinXP, 1.4.2_08) > >> > >>Why not switch to JSTL anyway, though? > >> > >>Dave > >> > >> > >> > >> > > > > > - > > > >>To unsubscribe, e-mail: > >>[EMAIL PROTECTED] > >>For additional commands, e-mail: > >>[EMAIL PROTECTED] > >> > >> > > > > > > > > > > > > __ > > Yahoo! FareChase: Search multiple travel sites in > one click. > > http://farechase.yahoo.com > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: issue with on JDK 1.4.2
You're checking whether userRequest exists as a session attribute, then trying to access it as a scripting variable. The one doesn't imply you can do the other. If you need to access userRequest from scriptlets, you'll need to use to create the scripting variable or lookup the bean in the session in your scriptlet: <%=session.getAttribute("userRequest").getReqType()%> L. Shyam Anand wrote: I figured that it's not a JDK issue and it is an application server issue. I use OC4J (Oracle IAS) and I'm upgrading from a version that supports JSP 1.1 to the one that is certified for JSP 1.2. So, could this be a JSP 1.1 - 1.2 compatibility issue? The JSP Compiler of the OC4J container doesn't seem to recognize the bean:define tags embedded inside Struts logic tags. See JSP code snippet below: And I get an error message when I access the "userRequest" bean's properties in my JSP: eg. Error: JspServlet: unable to dispatch to requested page: oracle.jsp.provider.JspCompileException: Errors compiling:[jsp src:line #:133] cannot resolve symbol: variable userRequest Any idea on what could be wrong here? Is there any workaround for this? I would not want to use JSTL as I have some time constraints. Any help will be greatly appreciated. Thanks, Shyam --- Dave Newton <[EMAIL PROTECTED]> wrote: Shyam Anand wrote: I have issues with struts-logic tags...I'm not using JSTL. Whoops. I'm running 1.4.2 w/o any struts tag issues (including 'logic'). (Tomcat, WinXP, 1.4.2_08) Why not switch to JSTL anyway, though? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please post this message on the users list
Sonali Kulkarni wrote: Subject: Problem using ActionMessages. Please Help! I am in the process of upgrading Struts from 1.0 to 1.2.7 Right now I am trying to change the error handling bit. However, I get the following error with the code changes I have made. Please let me know if any of you can figure out what can fix it. MY CODE: In the Action Class ActionMessages messages = new ActionMessages(); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage ("error.warning", "Some Error String")); saveMessages(request, messages); return (mapping.findForward("error")); //redirects to error.jsp If that's really a redirect (redirect="true" in the forward element in struts-config.xml, the default is false), you'll need to save the messages into the session rather than the request; request data isn't preserved across a redirect. MY CODE: error.jsp MY CODE: in ApplicationResources.properties error.error =Error: {0} error.warning =Warning: {0} MY CODE: in struts-config.xml (reference to properties file) Have you verified you have the file in the right place? Can you display messages from the resources elsewhere (e.g. using bean:message)? ERROR I GET >> javax.servlet.jsp.JspException: Cannot find bean msss in any scope at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:934) at org.apache.struts.taglib.bean.WriteTag.doStartTag WriteTag.java:225) at _web_2d_inf._error._jspService(_error.java:116) [SRC:/WEB-INF/error.jsp:45] I'm not sure about this; I thought the body of the html:messages tag was only meant to be evaluated if the message was not null; maybe this would happen if there's a key supplied for which no entry was found in the resources, though. Anyone? --- Line # 45 in error.jsp NOTE: If I dont use the Application Resources when creating the ActionMessage, and use a string instead .. It works! ActionMessage ae1 = new ActionMessage("This is a ERROR", false); works That certainly seems to suggest a problem with how you've deployed your application resources. See if you can access them directly using bean:message. If that doesn't work, go through the startup logs and see what Struts says about your resource bundle when it loads it. HTH, L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: issue with on JDK 1.4.2
I figured that it's not a JDK issue and it is an application server issue. I use OC4J (Oracle IAS) and I'm upgrading from a version that supports JSP 1.1 to the one that is certified for JSP 1.2. So, could this be a JSP 1.1 - 1.2 compatibility issue? The JSP Compiler of the OC4J container doesn't seem to recognize the bean:define tags embedded inside Struts logic tags. See JSP code snippet below: And I get an error message when I access the "userRequest" bean's properties in my JSP: eg. Error: JspServlet: unable to dispatch to requested page: oracle.jsp.provider.JspCompileException: Errors compiling:[jsp src:line #:133] cannot resolve symbol: variable userRequest Any idea on what could be wrong here? Is there any workaround for this? I would not want to use JSTL as I have some time constraints. Any help will be greatly appreciated. Thanks, Shyam --- Dave Newton <[EMAIL PROTECTED]> wrote: > Shyam Anand wrote: > > >I have issues with struts-logic tags...I'm not > using JSTL. > > > > > Whoops. > > I'm running 1.4.2 w/o any struts tag issues > (including 'logic'). > (Tomcat, WinXP, 1.4.2_08) > > Why not switch to JSTL anyway, though? > > Dave > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using ActionMessages!
Where is your ApplicationResources.properties file? Is it in WEB-INF/classes/ApplicationResources.properties? Try turning logging on in "debug" mode for Struts - you should see it load your message resources. Niall On 10/21/05, Sonali Kulkarni <[EMAIL PROTECTED]> wrote: > I am in the process of upgrading Struts from 1.0 to 1.2.7 Right now I > am trying to change the error handling bit. However, I get the > following error with the code changes I have made. Please let me know > if any of you can figure out what can fix it. > > MY CODE: In the Action Class > ActionMessages messages = new ActionMessages(); > messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage > ("error.warning", "Some Error String")); > saveMessages(request, messages); > return (mapping.findForward("error")); //redirects to error.jsp > > MY CODE: error.jsp > > > > > MY CODE: in ApplicationResources.properties > error.error =Error: {0} > error.warning =Warning: {0} > > MY CODE: in struts-config.xml (reference to properties file) > > > ERROR I GET >> > javax.servlet.jsp.JspException: Cannot find bean msss in any scope > at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:934) > at org.apache.struts.taglib.bean.WriteTag.doStartTag > WriteTag.java:225) at _web_2d_inf._error._jspService(_error.java:116) > [SRC:/WEB-INF/error.jsp:45] > > --- Line # 45 in error.jsp > > NOTE: If I dont use the Application Resources when creating the > ActionMessage, and use a string instead .. It works! > ActionMessage ae1 = new ActionMessage("This is a ERROR", false); works - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem using ActionMessages!
I am in the process of upgrading Struts from 1.0 to 1.2.7 Right now I am trying to change the error handling bit. However, I get the following error with the code changes I have made. Please let me know if any of you can figure out what can fix it. MY CODE: In the Action Class ActionMessages messages = new ActionMessages(); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage ("error.warning", "Some Error String")); saveMessages(request, messages); return (mapping.findForward("error")); //redirects to error.jsp MY CODE: error.jsp MY CODE: in ApplicationResources.properties error.error =Error: {0} error.warning =Warning: {0} MY CODE: in struts-config.xml (reference to properties file) ERROR I GET >> javax.servlet.jsp.JspException: Cannot find bean msss in any scope at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:934) at org.apache.struts.taglib.bean.WriteTag.doStartTag WriteTag.java:225) at _web_2d_inf._error._jspService(_error.java:116) [SRC:/WEB-INF/error.jsp:45] --- Line # 45 in error.jsp NOTE: If I dont use the Application Resources when creating the ActionMessage, and use a string instead .. It works! ActionMessage ae1 = new ActionMessage("This is a ERROR", false); works
Re: tag allow maxlength???
The HTML textarea tag has no maxlength attribute - this has nothing to do with struts. You can however add an onchange java script to do it, and then also check it on the back-end. Larry On 10/21/05, Carl Smith <[EMAIL PROTECTED]> wrote: > I need disallow a user from entering more than 2000 character in the > > tag, however,struts disallow the maxlength attribute on this tag, and > suggestions or > workaround? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tag allow maxlength???
I don't believe you can do a maxlength on a textarea in html. You may have to put in a validation (javascript or server side) to return an error message in case the user exceeds the count. From: Carl Smith <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" To: user@struts.apache.org Subject: tag allow maxlength??? Date: Fri, 21 Oct 2005 08:33:01 -0700 (PDT) I need disallow a user from entering more than 2000 character in the tag, however,struts disallow the maxlength attribute on this tag, and suggestions or workaround? - Yahoo! FareChase - Search multiple travel sites in one click. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tag allow maxlength???
I need disallow a user from entering more than 2000 character in the tag, however,struts disallow the maxlength attribute on this tag, and suggestions or workaround? - Yahoo! FareChase - Search multiple travel sites in one click.
Re: Please post this message on the users list
Did you try to put "ActionMessages.GLOBAL_MESSAGE" in I don't know, but I think that could work. Sonali Kulkarni <[EMAIL PROTECTED]To: user@struts.apache.org >cc: bcc: 21/10/2005 17:14 Subject: Please post this message on the users list Please respond to "Struts Users Mailing List" Subject: Problem using ActionMessages. Please Help! I am in the process of upgrading Struts from 1.0 to 1.2.7 Right now I am trying to change the error handling bit. However, I get the following error with the code changes I have made. Please let me know if any of you can figure out what can fix it. MY CODE: In the Action Class ActionMessages messages = new ActionMessages(); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage ("error.warning", "Some Error String")); saveMessages(request, messages); return (mapping.findForward("error")); //redirects to error.jsp MY CODE: error.jsp MY CODE: in ApplicationResources.properties error.error =Error: {0} error.warning =Warning: {0} MY CODE: in struts-config.xml (reference to properties file) ERROR I GET >> javax.servlet.jsp.JspException: Cannot find bean msss in any scope at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:934) at org.apache.struts.taglib.bean.WriteTag.doStartTag WriteTag.java:225) at _web_2d_inf._error._jspService(_error.java:116) [SRC:/WEB-INF/error.jsp:45] --- Line # 45 in error.jsp NOTE: If I dont use the Application Resources when creating the ActionMessage, and use a string instead .. It works! ActionMessage ae1 = new ActionMessage("This is a ERROR", false); works - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Please post this message on the users list
Subject: Problem using ActionMessages. Please Help! I am in the process of upgrading Struts from 1.0 to 1.2.7 Right now I am trying to change the error handling bit. However, I get the following error with the code changes I have made. Please let me know if any of you can figure out what can fix it. MY CODE: In the Action Class ActionMessages messages = new ActionMessages(); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage ("error.warning", "Some Error String")); saveMessages(request, messages); return (mapping.findForward("error")); //redirects to error.jsp MY CODE: error.jsp MY CODE: in ApplicationResources.properties error.error =Error: {0} error.warning =Warning: {0} MY CODE: in struts-config.xml (reference to properties file) ERROR I GET >> javax.servlet.jsp.JspException: Cannot find bean msss in any scope at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:934) at org.apache.struts.taglib.bean.WriteTag.doStartTag WriteTag.java:225) at _web_2d_inf._error._jspService(_error.java:116) [SRC:/WEB-INF/error.jsp:45] --- Line # 45 in error.jsp NOTE: If I dont use the Application Resources when creating the ActionMessage, and use a string instead .. It works! ActionMessage ae1 = new ActionMessage("This is a ERROR", false); works
Show validation errors in a frame
Greetings I've an iframe embedded in a .jsp. The iframe contents are another set of .jsps that contain a form submit (the reason we've done it like this is so that the embedded iframe looks like a tabbed diallog). When I submit the iframed form, I'd like to display the errors on the containing page, and highlight the offending field in the iframe via the errorStyleClass on the tag. I can the errors to show up on the containing jsp, but I can't figure out how to trick the iframed jsp to highlight the incorrect fields. Does anyone have a suggestion? thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts in Tomcat
Hi, I guess that your problem is because in your page inicio.jsp you have put a key that not exist in the resources file that you have declared in the strut's configuration file. I hope help you. Juan José Cuadrado Salomón Software Developer Mobile Phone: +34 654 37 38 59 ::: Email: [EMAIL PROTECTED] ilitia Technologies SRL Cerro del Águila, 9 - 28700 S. Sebastián de los Reyes - Madrid Teléfono: +34 91 652 58 08 ::: Fax: +34 91 623 84 68 ::: Web: www.ilitia.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts in Tomcat
I've installed Tomcat again. The error I'm getting now is this: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758) org.apache.jsp.inicio_jsp._jspService(inicio_jsp.java:85) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) In OC4J container it runs well. Can anyone help me? Thanks, Eider Wendy Smoak wrote: From: "Eider Iturbe" <[EMAIL PROTECTED]> I've developed a web application using JDeveloper and I've tested it using JDeveloper's embedded server, OC4J. Now I'm attempting that this web application works in Tomcat (version 5). But I've problems, because Tomcat can't compile some code. Do I have to install/add any library in Tomcat in order to Struts application works well? Possibly. If the other container is providing some libraries for you that Tomcat does not, then yes, you'll have to add them to your webapp or a common area in Tomcat as appropriate. What error message are you getting? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: iReport using Jasper reports
> -Original Message- > From: Meenakshi Singh [mailto:[EMAIL PROTECTED] > Sent: den 21 oktober 2005 15:44 > To: Struts Users Mailing List (E-mail) > Subject: iReport using Jasper reports > > Hi all, > > Has anyone used Jasper reports? > I have used the gui tool ireport to generate jasper reports > If yes then please let me know > 1) how can I call the jasper reports from a jsp page There are examples on the Jasper report homepage indicating how you can generate reports using Jasper report from a java class. Create a model that does this and call the model from the jsp page. Or look at the examples that are bundled with Jasper report and especially /demo/samples/webapp We store our report definitions as xml in a database. One issue you could have is where to store the report definitions in your web app. Using iReport or OpenReport Designer or just any xml editor is not relevant for Jasper, all it needs is it's xml definitions. Looking at the examples above should get you going. /Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
iReport using Jasper reports
Hi all, Has anyone used Jasper reports? I have used the gui tool ireport to generate jasper reports If yes then please let me know 1) how can I call the jasper reports from a jsp page 2) how do I integrate it with my application in WSAD. What all things wud I need to copy in WSAD etc. Thanks & Regards, Meenakshi. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: query string parameters problem
R.Vijayaraghavan asked: [snip] > The action is set to /submit.do. Since I am only sending the > description in the http request, only the setDescription() > method should be called and it happens so. The problem is > when I try to access the age and name variables from the > ActionForm in the Action class, I get null. Why so? I am not > setting age and name after submitting the form, they are > already set. The form is in session scope, so shouldn't it be re-used. You might want to add hidden fields in your HTML form so that the name and age get resubmitted. Or, if the data you want is already in session scope, have your Action read that data from there. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: MockStrutsTestCase issue
Kanuri, Chand asked: > hi, > i am using struts 1.2 and MockStrutsTestCase 2.1.3. > i an using eclipse. > i wrote a simple testcase for my action class it gives the > following errors > > log4j:WARN No appenders could be found for logger > (servletunit.struts.MockStrutsTestCase). > log4j:WARN Please initialize the log4j system properly. > > does it need any plugin? > > any ideas? Did you try googling before asking on the mailing list? Take a look at http://idiacomputing.com/moin/Log4jDotProperties - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:link and jstl
Good Call- The doc located at http://struts.apache.org/struts-taglib/tagreference-struts-html.html#link states that an action attribute forward,href,linkName or Page must be specified Also because you are passing in a string the EL Tag parser might choke on special characters such as $ OR { its a bit of a pain but you may want to consider where is standard hexadecimal representation of UTF-(8/16) assuming you know the encoding.. Standard caveats apply (YMMV) Martin- - Original Message - From: "Wendy Smoak" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Friday, October 21, 2005 1:32 AM Subject: Re: html:link and jstl Jadeler wrote: http://localhost:8080/testapp/StartBuyPolicy.do? x=${webProduct.id&y=${webProduct.productType} The above link seems to be coming from this: action="/StartBuyPolicy?x=${webProduct.id}&y=${webProduct.name}"> Buy product What version of the Servlet Specification are you working with and which version of the Struts taglibs? That you mention using to print the values implies Servlet 2.3, and if so you should be using Struts-EL. Add struts-el.jar to your webapp, and change the taglib to: <%@ taglib uri="http://struts.apache.org/tags-html-el"; prefix="html" %> (If you're on a Servlet 2.4 container... check your configuration, it should be evaluating the expressions anywhere in the page.) -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Displaytag reading column titles from application resources file
Thanks - For #1 - I assume you mean that the title attribute is not set in the tag. It is not. Setting it does seem to override the titleKey= attempt. #2 - I do have locale.resolver=org.displaytag.localization.I18nStrutsAdapter set in my displaytag.properties file. I have tried it with and without and it seems to make no difference. #3 - jstl.jar is in the war file. The way I am calling this tag is: . . . What I get printed out is just the property name as if I didn't specify any title. Dave "Martin Gainty" <[EMAIL PROTECTED] com> To "Struts Users Mailing List" 10/20/2005 04:56 PM cc Subject Please respond to Re: Displaytag reading column "Struts Users titles from application resources Mailing List" file <[EMAIL PROTECTED] he.org> Good Afternoon David Dumb question but I have to ask titleKey will retrieve a message via 1)title is not defined 2)displaytag.properties must contain the name of the i18nResourceProvider 2)assuming JSTL is available..JSTL.jar is included in your application.war M- - Original Message - From: "David Whipple" <[EMAIL PROTECTED]> To: Sent: Thursday, October 20, 2005 4:30 PM Subject: Displaytag reading column titles from application resources file > > I am having trouble trying to use Displaytag tag and reading the titles > for > the columns out of my application resources file. > > I have tried: > > > > ... > > > But it does not seem to read anything. > > I have tried searching for the answer, but haven't found anything that I > can make work. > > Does anyone have experience with this? > > Thanks, > Dave > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT DisplayTag] Re: Displaytag reading column titles from application resources file
Actually that is shorthand for what the tag is. The tag is something like "search.username". Dave Dave Newton <[EMAIL PROTECTED] com> To Struts Users Mailing List 10/20/2005 04:44 PM cc Subject Please respond to [OT DisplayTag] Re: Displaytag "Struts Users reading column titles from Mailing List" application resources file <[EMAIL PROTECTED] he.org> David Whipple wrote: > > > ... > > > You have a property called "" in your application resources file? If so, I guess I don't know, but I'd probably yell at you for a weird resource name. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: MockStrutsTestCase problem
No its NOT - /WEB-INF/web.xml.. Ur WEB-INF folder would be the within ur application context folder right.. The location/path of the application context folder is YOUR_APPLICATION_CONTEXT_PATH -Original Message- From: Kanuri, Chand [mailto:[EMAIL PROTECTED] Sent: Friday, October 21, 2005 5:46 PM To: 'Struts Users Mailing List' Subject: RE: MockStrutsTestCase problem Hi, what do you mean by YOUR_APPLICATION_CONTEXT_PATH? is that /WEB-INF/web.xml thanks -Original Message- From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED] Sent: 21 October 2005 13:05 To: 'Struts Users Mailing List' Subject: RE: MockStrutsTestCase problem U will have to set the context path of ur application: setContextDirectory(new File("YOUR_APPLICATION_CONTEXT_PATH")); Regards Anuradha -Original Message- From: Kanuri, Chand [mailto:[EMAIL PROTECTED] Sent: Friday, October 21, 2005 4:03 PM To: 'user@struts.apache.org' Subject: MockStrutsTestCase problem Hi all, I am using MockStrutsTestCase api to test my action classes. i set like this in my setUP() method setServletConfigFile("/WEB-INF/web.xml"); but the test fails and reports that /WEB-INF/web.xml is invalid path name any ideas? cheers The following companies are subsidiary companies of the Legal & General Group Plc which are authorised and regulated by the Financial Services Authority for advising and arranging the products shown: Legal & General Partnership Services Limited (insurance and mortgages), Legal & General Insurance Limited (insurance), Legal & General Assurance Society Limited (life assurance, pensions and investments), Legal & General Unit Trust Managers Limited and Legal & General Portfolio Management Services Limited (investments). They are registered in England under numbers shown. The registered office is Temple Court, 11 Queen Victoria Street, London EC4N 4TP. Legal & General Partnership Services Limited: 5045000 Legal & General Assurance Society Limited: 166055 Legal & General (Unit Trust Managers) Limited: 1009418 Legal & General (Portfolio Management Services) Limited: 2457525 Legal & General Insurance Limited: 423930 They are registered with the Financial Services Authority under numbers shown. You can check this at www.fsa.gov.uk/register Legal & General Partnership Services Limited: 300792 Legal & General Assurance Society Limited: 117659 Legal & General (Unit Trust Managers) Limited: 119273 Legal & General (Portfolio Management Services) Limited: 146786 Legal & General Insurance Limited: 202050 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts in Tomcat
From: "Eider Iturbe" <[EMAIL PROTECTED]> I've developed a web application using JDeveloper and I've tested it using JDeveloper's embedded server, OC4J. Now I'm attempting that this web application works in Tomcat (version 5). But I've problems, because Tomcat can't compile some code. Do I have to install/add any library in Tomcat in order to Struts application works well? Possibly. If the other container is providing some libraries for you that Tomcat does not, then yes, you'll have to add them to your webapp or a common area in Tomcat as appropriate. What error message are you getting? -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: MockStrutsTestCase problem
Hi, what do you mean by YOUR_APPLICATION_CONTEXT_PATH? is that /WEB-INF/web.xml thanks -Original Message- From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED] Sent: 21 October 2005 13:05 To: 'Struts Users Mailing List' Subject: RE: MockStrutsTestCase problem U will have to set the context path of ur application: setContextDirectory(new File("YOUR_APPLICATION_CONTEXT_PATH")); Regards Anuradha -Original Message- From: Kanuri, Chand [mailto:[EMAIL PROTECTED] Sent: Friday, October 21, 2005 4:03 PM To: 'user@struts.apache.org' Subject: MockStrutsTestCase problem Hi all, I am using MockStrutsTestCase api to test my action classes. i set like this in my setUP() method setServletConfigFile("/WEB-INF/web.xml"); but the test fails and reports that /WEB-INF/web.xml is invalid path name any ideas? cheers The following companies are subsidiary companies of the Legal & General Group Plc which are authorised and regulated by the Financial Services Authority for advising and arranging the products shown: Legal & General Partnership Services Limited (insurance and mortgages), Legal & General Insurance Limited (insurance), Legal & General Assurance Society Limited (life assurance, pensions and investments), Legal & General Unit Trust Managers Limited and Legal & General Portfolio Management Services Limited (investments). They are registered in England under numbers shown. The registered office is Temple Court, 11 Queen Victoria Street, London EC4N 4TP. Legal & General Partnership Services Limited: 5045000 Legal & General Assurance Society Limited: 166055 Legal & General (Unit Trust Managers) Limited: 1009418 Legal & General (Portfolio Management Services) Limited: 2457525 Legal & General Insurance Limited: 423930 They are registered with the Financial Services Authority under numbers shown. You can check this at www.fsa.gov.uk/register Legal & General Partnership Services Limited: 300792 Legal & General Assurance Society Limited: 117659 Legal & General (Unit Trust Managers) Limited: 119273 Legal & General (Portfolio Management Services) Limited: 146786 Legal & General Insurance Limited: 202050 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Load datasource config without action classes
Configure a JNDI data-source. Different application servers do it differently. regards, vijay. > -Original Message- > From: M4RC0 [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 18, 2005 4:22 PM > To: Struts Users Mailing List > Subject: Load datasource config without action classes > > > Hi > i'm thinking about loading struts-config datasources configuration > directly to my business classes, but i appears to be necesary to use > action clases (by calling getDataSource method). is it possible to > use a load-on-startup servlet to get struts configured datasources (or > something similar, instead action clases)?? > I really like the form how struts configure databases but i preffer to > link those databases directly to my business tier. > > I'm opened to other options instead :) > > Any idea? thanks all! > > -- > M4RC0 > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: MockStrutsTestCase problem
Kanuri, Chand wrote: Hi all, I am using MockStrutsTestCase api to test my action classes. i set like this in my setUP() method setServletConfigFile("/WEB-INF/web.xml"); but the test fails and reports that /WEB-INF/web.xml is invalid path name any ideas? This isn't really the place to be asking. Struts Test Case is an independant project from Struts. There may be people here who have used it, but you'll get more help on the Struts Test Case formums [1]. L. [1] http://sourceforge.net/forum/forum.php?forum_id=121751 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: MockStrutsTestCase problem
U will have to set the context path of ur application: setContextDirectory(new File("YOUR_APPLICATION_CONTEXT_PATH")); Regards Anuradha -Original Message- From: Kanuri, Chand [mailto:[EMAIL PROTECTED] Sent: Friday, October 21, 2005 4:03 PM To: 'user@struts.apache.org' Subject: MockStrutsTestCase problem Hi all, I am using MockStrutsTestCase api to test my action classes. i set like this in my setUP() method setServletConfigFile("/WEB-INF/web.xml"); but the test fails and reports that /WEB-INF/web.xml is invalid path name any ideas? cheers The following companies are subsidiary companies of the Legal & General Group Plc which are authorised and regulated by the Financial Services Authority for advising and arranging the products shown: Legal & General Partnership Services Limited (insurance and mortgages), Legal & General Insurance Limited (insurance), Legal & General Assurance Society Limited (life assurance, pensions and investments), Legal & General Unit Trust Managers Limited and Legal & General Portfolio Management Services Limited (investments). They are registered in England under numbers shown. The registered office is Temple Court, 11 Queen Victoria Street, London EC4N 4TP. Legal & General Partnership Services Limited: 5045000 Legal & General Assurance Society Limited: 166055 Legal & General (Unit Trust Managers) Limited: 1009418 Legal & General (Portfolio Management Services) Limited: 2457525 Legal & General Insurance Limited: 423930 They are registered with the Financial Services Authority under numbers shown. You can check this at www.fsa.gov.uk/register Legal & General Partnership Services Limited: 300792 Legal & General Assurance Society Limited: 117659 Legal & General (Unit Trust Managers) Limited: 119273 Legal & General (Portfolio Management Services) Limited: 146786 Legal & General Insurance Limited: 202050 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts in Tomcat
Hi Struts users! I've developed a web application using JDeveloper and I've tested it using JDeveloper's embedded server, OC4J. Now I'm attempting that this web application works in Tomcat (version 5). But I've problems, because Tomcat can't compile some code. Do I have to install/add any library in Tomcat in order to Struts application works well? Thanks in advance, Eider - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Form field values.. regarding]
i feel this is not required since this is handled by the struts and the form bean. Laurie Harper wrote: Yes, that will work; but if you do that, the field will always be displayed empty (or with whatever value you specify). Again, that reduces the amount of feedback to the user when redisplaying the form following validation failure. Using 'value' works well when you always want to force the input to a particular value, regardless of what is loaded into the form from your database or following a form submit and redisplay. That's usually not what you want though :-) L. Deva Pitchai(NatureSoft) wrote: you mean to say that in struts tag we can have " value='' "attribute? [EMAIL PROTECTED] wrote: Hi, You can use the value="" attribute in the tag in which you don't want the default values to be loaded. This doe not require any special method. Regards, Rajasekhar Cherukuri "Deva Pitchai(NatureSoft)" <[EMAIL PROTECTED]> 10/21/2005 01:10 PM Please respond to "Struts Users Mailing List" To Struts Users Mailing List cc Subject [Form field values.. regarding] [With snapshot attached] Hi group hope you all must come across this situation... If u can tell me how to solve this... i will be very much thankful when i edit a form (say with 10 fields in it. some are dropdown, textbox etc), the non-mandatory fields are displaying 0.0 as the field value, which is the value from the database. Now my question is is there any simple way to avoid this kind of displaying 0.0. Or I need to write a method to make it as null Thanks in adv Deva - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ForwardSourceID:NT661E Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Form field values.. regarding]
Yes, that will work; but if you do that, the field will always be displayed empty (or with whatever value you specify). Again, that reduces the amount of feedback to the user when redisplaying the form following validation failure. Using 'value' works well when you always want to force the input to a particular value, regardless of what is loaded into the form from your database or following a form submit and redisplay. That's usually not what you want though :-) L. Deva Pitchai(NatureSoft) wrote: you mean to say that in struts tag we can have " value='' "attribute? [EMAIL PROTECTED] wrote: Hi, You can use the value="" attribute in the tag in which you don't want the default values to be loaded. This doe not require any special method. Regards, Rajasekhar Cherukuri "Deva Pitchai(NatureSoft)" <[EMAIL PROTECTED]> 10/21/2005 01:10 PM Please respond to "Struts Users Mailing List" To Struts Users Mailing List cc Subject [Form field values.. regarding] [With snapshot attached] Hi group hope you all must come across this situation... If u can tell me how to solve this... i will be very much thankful when i edit a form (say with 10 fields in it. some are dropdown, textbox etc), the non-mandatory fields are displaying 0.0 as the field value, which is the value from the database. Now my question is is there any simple way to avoid this kind of displaying 0.0. Or I need to write a method to make it as null Thanks in adv Deva - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ForwardSourceID:NT661E Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Form field values.. regarding]
Deva Pitchai(NatureSoft) wrote: How are you getting the data from your database into your form? If you're using an ActionForm and you have primitive typed properties (float, for example) the easiest quick-fix would be to use the corresponding wrapper type (e.g. Float). wht u guessed is right. I will try to use the wrapper class Thanks OK. You might also want to consider using String rather than a number type like Float. The reason is, you can then redisplay invalid data for the user to correct. For example, if the user types in 'xyz' validation should fail. If you have the form property type as Float, you now can't redisplay that input (because a Float object can't represent the entered value, 'xyz'). With a String, the form will redisplay with the incorrect value along with your validation error message, so the user can see what he entered wrong. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
MockStrutsTestCase problem
Hi all, I am using MockStrutsTestCase api to test my action classes. i set like this in my setUP() method setServletConfigFile("/WEB-INF/web.xml"); but the test fails and reports that /WEB-INF/web.xml is invalid path name any ideas? cheers The following companies are subsidiary companies of the Legal & General Group Plc which are authorised and regulated by the Financial Services Authority for advising and arranging the products shown: Legal & General Partnership Services Limited (insurance and mortgages), Legal & General Insurance Limited (insurance), Legal & General Assurance Society Limited (life assurance, pensions and investments), Legal & General Unit Trust Managers Limited and Legal & General Portfolio Management Services Limited (investments). They are registered in England under numbers shown. The registered office is Temple Court, 11 Queen Victoria Street, London EC4N 4TP. Legal & General Partnership Services Limited: 5045000 Legal & General Assurance Society Limited: 166055 Legal & General (Unit Trust Managers) Limited: 1009418 Legal & General (Portfolio Management Services) Limited: 2457525 Legal & General Insurance Limited: 423930 They are registered with the Financial Services Authority under numbers shown. You can check this at www.fsa.gov.uk/register Legal & General Partnership Services Limited: 300792 Legal & General Assurance Society Limited: 117659 Legal & General (Unit Trust Managers) Limited: 119273 Legal & General (Portfolio Management Services) Limited: 146786 Legal & General Insurance Limited: 202050 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Serialize Form-Beans with a Database. A good strategy?
as long as you only use it as blob, store and retrieve it, without querying subforms, a byte[] gained through serialization or externalization would be surely the faster alternative... regards leon On 10/21/05, gollinger <[EMAIL PROTECTED]> wrote: > Ciao, > > I've planned to transform a Form-Bean to a XML-String > and but it into a Databasetable-field, among with others as the > user-id or the form-name. > > Is there anything you can say against this procedure? > > Ciao Antonio > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
query string parameters problem
Hello, I have 3 variables, namely age, name and description. I have the values for name and age before sending the request. That is, my URL would look like http://localhost:8080/vijay/submit.do?name=xyz&age=22 I have a form that sets the values of age and name which is then accessed in a html page using bean:write. In the html page, the user will enter the description in the corrosponding textarea. The action is set to /submit.do. Since I am only sending the description in the http request, only the setDescription() method should be called and it happens so. The problem is when I try to access the age and name variables from the ActionForm in the Action class, I get null. Why so? I am not setting age and name after submitting the form, they are already set. The form is in session scope, so shouldn't it be re-used. Or am I understanding it in-correctly. regards, vijay. Sorry if the subject of the mail is not proper, I couldn't think of any other subject. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Serialize Form-Beans with a Database. A good strategy?
Ciao, I've planned to transform a Form-Bean to a XML-String and but it into a Databasetable-field, among with others as the user-id or the form-name. Is there anything you can say against this procedure? Ciao Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Form field values.. regarding]
you mean to say that in struts tag we can have " value='' "attribute? [EMAIL PROTECTED] wrote: Hi, You can use the value="" attribute in the tag in which you don't want the default values to be loaded. This doe not require any special method. Regards, Rajasekhar Cherukuri "Deva Pitchai(NatureSoft)" <[EMAIL PROTECTED]> 10/21/2005 01:10 PM Please respond to "Struts Users Mailing List" To Struts Users Mailing List cc Subject [Form field values.. regarding] [With snapshot attached] Hi group hope you all must come across this situation... If u can tell me how to solve this... i will be very much thankful when i edit a form (say with 10 fields in it. some are dropdown, textbox etc), the non-mandatory fields are displaying 0.0 as the field value, which is the value from the database. Now my question is is there any simple way to avoid this kind of displaying 0.0. Or I need to write a method to make it as null Thanks in adv Deva - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ForwardSourceID:NT661E Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Form field values.. regarding]
inline reply! Laurie Harper wrote: Deva Pitchai(NatureSoft) wrote: Hi group hope you all must come across this situation... If u can tell me how to solve this... i will be very much thankful when i edit a form (say with 10 fields in it. some are dropdown, textbox etc), the non-mandatory fields are displaying 0.0 as the field value, which is the value from the database. Now my question is is there any simple way to avoid this kind of displaying 0.0. Or I need to write a method to make it as null How are you getting the data from your database into your form? If you're using an ActionForm and you have primitive typed properties (float, for example) the easiest quick-fix would be to use the corresponding wrapper type (e.g. Float). wht u guessed is right. I will try to use the wrapper class Thanks Without knowing more about how your pages are put together it's difficult to offer more specific advice, but feel free to post more details of what you're doing now if you need more guidance. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Form field values.. regarding]
Hi, You can use the value="" attribute in the tag in which you don't want the default values to be loaded. This doe not require any special method. Regards, Rajasekhar Cherukuri "Deva Pitchai(NatureSoft)" <[EMAIL PROTECTED]> 10/21/2005 01:10 PM Please respond to "Struts Users Mailing List" To Struts Users Mailing List cc Subject [Form field values.. regarding] [With snapshot attached] Hi group hope you all must come across this situation... If u can tell me how to solve this... i will be very much thankful when i edit a form (say with 10 fields in it. some are dropdown, textbox etc), the non-mandatory fields are displaying 0.0 as the field value, which is the value from the database. Now my question is is there any simple way to avoid this kind of displaying 0.0. Or I need to write a method to make it as null Thanks in adv Deva - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ForwardSourceID:NT661E Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
MockStrutsTestCase issue
hi, i am using struts 1.2 and MockStrutsTestCase 2.1.3. i an using eclipse. i wrote a simple testcase for my action class it gives the following errors log4j:WARN No appenders could be found for logger (servletunit.struts.MockStrutsTestCase). log4j:WARN Please initialize the log4j system properly. does it need any plugin? any ideas? thanks The following companies are subsidiary companies of the Legal & General Group Plc which are authorised and regulated by the Financial Services Authority for advising and arranging the products shown: Legal & General Partnership Services Limited (insurance and mortgages), Legal & General Insurance Limited (insurance), Legal & General Assurance Society Limited (life assurance, pensions and investments), Legal & General Unit Trust Managers Limited and Legal & General Portfolio Management Services Limited (investments). They are registered in England under numbers shown. The registered office is Temple Court, 11 Queen Victoria Street, London EC4N 4TP. Legal & General Partnership Services Limited: 5045000 Legal & General Assurance Society Limited: 166055 Legal & General (Unit Trust Managers) Limited: 1009418 Legal & General (Portfolio Management Services) Limited: 2457525 Legal & General Insurance Limited: 423930 They are registered with the Financial Services Authority under numbers shown. You can check this at www.fsa.gov.uk/register Legal & General Partnership Services Limited: 300792 Legal & General Assurance Society Limited: 117659 Legal & General (Unit Trust Managers) Limited: 119273 Legal & General (Portfolio Management Services) Limited: 146786 Legal & General Insurance Limited: 202050 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to display an error image next to an invalid form field?
Mon Cab wrote: I have read the struts documentation and am trying to work out how I would display an error image next to an invalid form field. Ramesh mentioned that would display the error message associated with a particular field. Is there a (set of) struts tag(s) that would test whether a form field were invalid? (Maybe a combination of html and logic tags). I would like to do this without implementing any ActionForms. Ideally I would like to specify DynaValidatorForms in the struts-config file, and specify field validations for those forms in the validation.xml file. I am presuming that the struts framework would then generate a DynaValidatorForm object after the html form were submitted. I am also presuming that this would automatically populate the so that I could print the errors in my page, and I could print individual errors using . (Is this correct ??) More or less, yes. Is there a way of using struts tags to test for the validity of a specific form field. How would this be written? If not, what are the work arounds? I'm not sure I understand what you want to do. You don't need to use any tags to test whether form fields contain valid data; Struts will do that for you based on your validator rules, as you describe above. The tag will then take care of figuring out whether there's anything to display automatically. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Form field values.. regarding]
Deva Pitchai(NatureSoft) wrote: Hi group hope you all must come across this situation... If u can tell me how to solve this... i will be very much thankful when i edit a form (say with 10 fields in it. some are dropdown, textbox etc), the non-mandatory fields are displaying 0.0 as the field value, which is the value from the database. Now my question is is there any simple way to avoid this kind of displaying 0.0. Or I need to write a method to make it as null How are you getting the data from your database into your form? If you're using an ActionForm and you have primitive typed properties (float, for example) the easiest quick-fix would be to use the corresponding wrapper type (e.g. Float). Without knowing more about how your pages are put together it's difficult to offer more specific advice, but feel free to post more details of what you're doing now if you need more guidance. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Form field values.. regarding]
[With snapshot attached] Hi group hope you all must come across this situation... If u can tell me how to solve this... i will be very much thankful when i edit a form (say with 10 fields in it. some are dropdown, textbox etc), the non-mandatory fields are displaying 0.0 as the field value, which is the value from the database. Now my question is is there any simple way to avoid this kind of displaying 0.0. Or I need to write a method to make it as null Thanks in adv Deva - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
nested and jstl iterate
Just curious before looking into it in a big way, but is there now a major amount of duplication between nested taglibs and jstl c:iterate, c:set, c:out with EL? I assume nested is considered 'finished' - does this mean that it will be replaced over time by JSTL? (I don't mean in the struts distro, I mean generally in usage terms) Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Form field values.. regarding]
Hi group hope you all must come across this situation... If u can tell me how to solve this... i will be very much thankful when i edit a form (say with 10 fields in it. some are dropdown, textbox etc), the non-mandatory fields are displaying 0.0 as the field value, which is the value from the database. Now my question is is there any simple way to avoid this kind of displaying 0.0. Or I need to write a method to make it as null Thanks in adv Deva - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:link and jstl
Thanks Wendy. I just needed that library (since im using servlet 2.3 spec) and now it works. Jadeler --- Wendy Smoak <[EMAIL PROTECTED]> wrote: > Jadeler wrote: > > > http://localhost:8080/testapp/StartBuyPolicy.do? > > x=${webProduct.id&y=${webProduct.productType} > > The above link seems to be coming from this: > > > > > action="/StartBuyPolicy?x=${webProduct.id}&y=${webProduct.name}"> > > Buy product > > > > What version of the Servlet Specification are you > working with and which > version of the Struts taglibs? > > That you mention using to print the values > implies Servlet 2.3, and > if so you should be using Struts-EL. Add > struts-el.jar to your webapp, and > change the taglib to: ><%@ taglib > uri="http://struts.apache.org/tags-html-el"; > prefix="html" %> > > (If you're on a Servlet 2.4 container... check your > configuration, it should > be evaluating the expressions anywhere in the page.) > > -- > Wendy Smoak > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Find your next car at http://autos.yahoo.ca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: testing struts
It looks like the home page for mockstrutstestcase is your best starting point. http://strutstestcase.sourceforge.net/ hem hem on 20/10/05 23:49, wrote: Hi Adam, thanks for your reply, i my struts(version 1.2) web app,i am using tiles, action form are submitted through tiles(jsp)templates. i am having a helper class which copies property values from form bean to model object. i call the methods in this helper class from my action class and put some data in the session. i think you got complete picture of my app.there is no businees logic in my action(just copying proprties and putting them in session). i want to test my action class for below: 1.when the form is populated or not properly 2.am i going to the next page properly(testing action forward and action mapping) 3.us the information is properly set into the session all these common struts action things. if you can suggest me the best approach i will start with that. i heard mockstrutstestcase is there. i dont know how to use it. can you please suggest me the best simple tutorial so thst it saves my time. struts version=1.2 mochstrutstestcase version=2.3 your suggestions are very much appreciated regards and thanks in advance Adam Hardy <[EMAIL PROTECTED]> wrote: hem hem on 20/10/05 22:57, wrote: i am using struts jar 1.2 in my web app. i want to test my struts action classes and jsps using Junit are there any nice tutorials on this. i want to use MockStrutsTestcase in my junit tests What precisely do you want to test? There are many different junit compatible test tutorials but when I went looking, I was disappointed because they all focused on a little niche of testing rather than a broad basis offering the whole range. Right now what comes to mind is: (1) the model, if you have any model / business logic in your actions (which is not advisable, since it's easier testing it if seperate), or perhaps validation of http request params. (2) the controller, or flow of control logic - testing ActionForwards returned, looking in mock request or session scopes for expected objects (3) view logic, presentation code - do JSPs compile, are all required Tiles defined, do JSPs throw exceptions at runtime. Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Yahoo! FareChase - Search multiple travel sites in one click. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]