Error handling (ServletException)
Is there something special I have to do to handle a ServletException? No matter what I try, the stack trace always seems to be sent to the standard Tomcat error page. I've tried configuring global-exceptions in struts-config, but that doesn't seem to work. What's the secret? global-exceptions exception handler=org.apache.struts.action.ExceptionHandler key=global.error.message path=/error scope=request type=javax.servlet.ServletException / /global-exceptions javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:980) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcess or.java:779) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 246) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) Thanks! Pete -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [FRIDAY] Best error message ever
I don't think this will trump any of the fine examples posted so far, but I have always found this gsu error message amusing: gsu: you won't be doing that today. This is what you get if you try to gsu to an account that you don't have access to. -Max - Original Message - From: Nelson, Laird [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 13, 2002 9:42 AM Subject: [FRIDAY] Best error message ever Just ran across this error message in an old legacy system (I couldn't make this up if I tried): Unspecified security problem. Please investigate yourself, but call [name changed to protect the innocent] team if you get stuck. Cheers, Laird -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Error handling (ServletException)
Your action throws an Exception which got rethrow as ServletException by the controller if the original exception is not caught by your handler. So you need to change your configuration to catch Exception ( or whatever the real one is) not ServletException. Hope this helps. -D - Original Message - From: Pete Gieser [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, December 15, 2002 12:54 AM Subject: Error handling (ServletException) Is there something special I have to do to handle a ServletException? No matter what I try, the stack trace always seems to be sent to the standard Tomcat error page. I've tried configuring global-exceptions in struts-config, but that doesn't seem to work. What's the secret? global-exceptions exception handler=org.apache.struts.action.ExceptionHandler key=global.error.message path=/error scope=request type=javax.servlet.ServletException / /global-exceptions javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:980) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcess or.java:779) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 246) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) Thanks! Pete -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
html:select question
Howdy folks, I am having some problems and hope somebody can help. Using struts-example as a starting point, I would like to move the following decalration out of the jsp page and into the ActionBean(for the sake of this example, we add it there): java.util.ArrayList list = new java.util.ArrayList(); list.add(new example.LabelValueBean(one, 1)); list.add(new example.LabelValueBean(two, 2)); list.add(new example.LabelValueBean(three, 3)); list.add(new example.LabelValueBean(four, 4)); so in my FormBean and DataBean I added the setter and getter methods to accomodate the above declaration eg: private ArrayList list = null; private String select = one; public void ArrayList getList(){ return list; } public void setList(ArrayList list){ this.list=list; } public void String getSelect(){ return select; } public void setSelect(String select){ this.select=select; } and added the list to the DataBean(which is used to populate the FormBean) in the ActionBean: ... data.setList(list); ... now for the problem, how should i define the html:select and html:options tags to get it to display the ArrayList instantiated in the ActionBean? html:select property=select html:options collection=list property=value labelProperty=label/ /html:select but this does not work. Any help will be greatly appreciated. Thanks William -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: html:select question
Figured it out, I needed to add: session.setAttribute(list, list); To my ActionBean Cheers William William Miles wrote: Howdy folks, I am having some problems and hope somebody can help. Using struts-example as a starting point, I would like to move the following decalration out of the jsp page and into the ActionBean(for the sake of this example, we add it there): java.util.ArrayList list = new java.util.ArrayList(); list.add(new example.LabelValueBean(one, 1)); list.add(new example.LabelValueBean(two, 2)); list.add(new example.LabelValueBean(three, 3)); list.add(new example.LabelValueBean(four, 4)); so in my FormBean and DataBean I added the setter and getter methods to accomodate the above declaration eg: private ArrayList list = null; private String select = one; public void ArrayList getList(){ return list; } public void setList(ArrayList list){ this.list=list; } public void String getSelect(){ return select; } public void setSelect(String select){ this.select=select; } and added the list to the DataBean(which is used to populate the FormBean) in the ActionBean: ... data.setList(list); ... now for the problem, how should i define the html:select and html:options tags to get it to display the ArrayList instantiated in the ActionBean? html:select property=select html:options collection=list property=value labelProperty=label/ /html:select but this does not work. Any help will be greatly appreciated. Thanks William -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Move to TilesRequestProcessor results in forwarding exception.
If I specify a Tiles definition file I must supply at least one definition. Otherwise I get this: org.xml.sax.SAXParseException: The content of element type tiles-definitions is incomplete, it must match (definition)+. So my Tiles definition file looks like: tiles-definitions definition name=dummy path=/layouts/dummyLayout.jsp/ /tiles-definitions The file layouts/dummyLayout.jsp does not actually exist. However I seem to get no errors at runtime. So I think I've got the right configuration now to proceed with a refactoring toward Tiles. Whew! -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 5:26 PM To: Struts Users Mailing List Subject: RE: Move to TilesRequestProcessor results in forwarding exception. With just the controller processorClass=org.apache.struts.tiles.TilesRequestProcessor/ I get the following error. 2002-12-13 17:07:57 action: Error - TilesRequestProcessor : Definition Factory not found for subapp ''. Do you have declared appropriate plugin in struts-config.xml ? If instead I use the plug-in element in struts-config I get the following log. 2002-12-13 17:19:05 action: Tiles definition factory loaded for processor ''. When accessing the webapp I get a runtime exception. 2002-12-13 17:20:26 ApplicationDispatcher[/StrutsLogTest] Servlet.service() for servlet action threw exception java.lang.NullPointerException at org.apache.struts.tiles.xmlDefinition.FactorySet.getDefinition(Fac torySet.ja va:156) It appears that a definitions file is required. But from reading both the package documentation, Husted's Tiles chapter, and Caverness' Tiles chapter they all indicate that the definitions file is optional. I wanted to refactor toward the use of a definitions file (following Husted's instructions in his Tiles chapter). I guess I can add a dummy definition and see if that appeases tiles. Any thoughts on this? -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 12:46 PM To: Struts Users Mailing List Subject: RE: Move to TilesRequestProcessor results in forwarding exception. Cedric, My webapp makes no use of Tiles yet. The first step in my refactoring was to add the tiles plug-in. That is where I'm stuck. I have no tiles definitions yet. So do I still need a tiles definitions file? For some reason I can't get Tiles logging to work. I see that it uses the servlet.log but I can't get that to work either. Tried setting debug to 99 in web.xml but it has no effect. I'll keep trying to get logging to work and let you know what I see. -Original Message- From: Cedric Dumoulin [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 5:21 PM To: Struts Users Mailing List Subject: Re: Move to TilesRequestProcessor results in forwarding exception. Well, let start on good basis: to use Tiles, you should declare the tiles plugin and specify a tiles config file. You don't need to specify the TilesRequestProcessor yourself. The debug s properties of TilesRequestProcessor don't work anymore: they are replaced by a common logging mechanism. You should see some messages from the TilesPlugin, indicating what happens. Cedric Jerome Jacobsen wrote: OK. I added the following to my struts-config: controller processorClass=org.apache.struts.tiles.TilesRequestProcessor debug=9/ plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-debug value=2/ set-property property=definitions-parser-details value=2/ /plug-in And the following to my log4j.properties (in case Tiles uses Commons Logging): log4j.category.org.apache.struts.tiles=DEBUG The logging output shows no Tiles logs. It is: Target URL -- http://localhost:8080/Sandbox-FPRSAcceptanceClient-context-root/index.jsp 2002-12-12 16:38:08,073 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.FprsBaseAction - BEGIN execute(ActionMapping,...) 2002-12-12 16:38:08,103 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - BEGIN initialize(ActionMapping, ...) 2002-12-12 16:38:08,103 [HttpRequestHandler-532] INFO com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - Unable to find localeForm in the session. 2002-12-12 16:38:08,203 [HttpRequestHandler-532] WARN com.metalsa.orator.fprs.ui.web.struts.ModelFacade - Get Locales from database. 2002-12-12 16:38:08,223 [HttpRequestHandler-532] INFO com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - Added localeForm to the session. 2002-12-12 16:38:08,223 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - END
logic:iterate
Hi: Have you used pager tag library from http://jsptags.com/tags/navigation/pager/ with logic:iterate tag? I am using them together, and I have a problem. Please help me if you know what's going on in the following problem. I really appreciate your help.(Rick suggested me to use display tag from http://edhill.its.uiowa.edu/display-0.8/. I had a look. And it's excellent. However, the project is almost in production phase, I prefer to fix the problem based on what I have now instead of changing the implementation. Thank Rick, anyway). I retrieved 23 rows from Database, and I saved the data in session. I want to display the data on 10 rows/page basis with page navigation ability.So on the first page, there are 10 rows and a next link, On the second page, there are 10 rows and previous and next link. On the third page, there are 3 rows and a previous link. I used logic:iterate to iterate through the data, and use pager tag library from the above link to implement the page navigation ability.The following is my jsp snippets: %@ taglib uri=/WEB-INF/pager-taglib.tld prefix=pg % .. pg:pager maxPageItems=10 isOffset = true logic:iterate id=aResult name=results scope=session type=com.test.Result pg:item tr td bean:write name=aResult property=note/ /td logic:notEqual name=aResult property=amount value=0 td bean:message key=amount.value//font/div /td /logic:equal /tr /pg:item /logic:iterate -- page navigation area-- /pg:pager Page navigation works fine(I mean when I click next or previous, it goes to next or previous page. So I omitted the page navigation snippest. The problem is: when the first page is displayed, I viewed the source of the first page, there are 10 blank rows before the line -- page navigation area-- -- I mean there is a big spaces which is equal to 10 rows, between the last row and the line -- page navigation area--. After I click next link and opened the second page, I viewed the source, I found between the last row on the page and the line -- page navigation area--, there are 3 blank rows(because the next page has 3 rows). When I opened the third page(last page), and viewed source, there is no blank row(because there is no next page). In order to solve the problem, I searched the archive and the web. I found lot of disussion about paging. But there seems no discussion about the blank rows problem. Could you help me out here. I spend a lot of time trying to fix it, but no clue. I really appreciate your help. Thank you very much. Cathy
Iterate tag Tomcat 4.1.12, issue or no?
After much scanning of the user-list archive I have seen some mentions of a problem with tomcat 4.1 and the logic:iterate tag. I have also seen mentions of Tomcat 4.1.12 working fine with the logic tag. Does a problem exist? I am getting the following error, my code matches the example code in the logic taglib guide, so I am out of ideas on what is wrong. ERROR: cannot resolve symbol symbol : variable myMessage Code in JSP: % SessionUtility su = new SessionUtility(); ArrayList messages = (ArrayList) su.getAttribute(session, HomeConstants.MESSAGE_ARRAY); % table TR TD !-- Begin Display of Messages -- %= messages.size() % logic:iterate id=myMessage collection=%=messages% %= myMessage.getSubject() % /logic:iterate If I remove the logic tag completely the messages.size() tells me that I have two Objects in the array list, so I know the information is in there I just can't get to it. I have also tried this with the type=com.mysystem.bo.bean.Message set as well, still It does not work. Any Ideas? Thank you for your help, Mark
struts-example 1.1b installation on Webshphere 5.0
Hello,I installed struts-sample on Webshpere 5.0 application server and only took me 10 minutes. I used Administrative Console from web browser. Go to Applications - Install New Application. Browse the struts-example.war in my Local Path and type in struts-example in Context Root. Click next. And next again. Check web module. And next and next. Then done!. It's a lot easier to install the example in websphere 5.0 than 3.5. Eric -- __ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup Meet Singles http://corp.mail.com/lavalife -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Iterate tag Tomcat 4.1.12, issue or no?
On Sun, 15 Dec 2002 15:39:23 -0500 Mark Conlin [EMAIL PROTECTED] wrote: %= messages.size() % logic:iterate id=myMessage collection=%=messages% %= myMessage.getSubject() % /logic:iterate Try collection=messages (without the scriplets). -- Rick -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Iterate tag Tomcat 4.1.12, issue or no?
I am afraid that still does not work. None of these work logic:iterate id=myMessage collection=%=messages% logic:iterate id=myMessage collection=%=messages% logic:iterate id=myMessage collection=messages -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 15, 2002 7:22 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: Re: Iterate tag Tomcat 4.1.12, issue or no? On Sun, 15 Dec 2002 15:39:23 -0500 Mark Conlin [EMAIL PROTECTED] wrote: %= messages.size() % logic:iterate id=myMessage collection=%=messages% %= myMessage.getSubject() % /logic:iterate Try collection=messages (without the scriplets). -- Rick -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Iterate tag Tomcat 4.1.12, issue or no?
% SessionUtility su = new SessionUtility(); ArrayList messages = (ArrayList)su.getAttribute(session, HomeConstants.MESSAGE_ARRAY); pageContext.setAttribute(messages, messages); % logic:iterate id=myMessage name=messages Mark Conlin wrote: I am afraid that still does not work. None of these work logic:iterate id=myMessage collection=%=messages% logic:iterate id=myMessage collection=%=messages% logic:iterate id=myMessage collection=messages -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 15, 2002 7:22 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: Re: Iterate tag Tomcat 4.1.12, issue or no? On Sun, 15 Dec 2002 15:39:23 -0500 Mark Conlin [EMAIL PROTECTED] wrote: %= messages.size() % logic:iterate id=myMessage collection=%=messages% %= myMessage.getSubject() % /logic:iterate Try collection=messages (without the scriplets). -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Iterate tag Tomcat 4.1.12, issue or no?
Thanks folks, but that does not work either. So I tried the code from the example in the struts developers Guide. It doesn't work either. % java.util.ArrayList list = new java.util.ArrayList(); list.add(First); list.add(Second); list.add(Third); list.add(Fourth); list.add(Fifth); pageContext.setAttribute(list, list, PageContext.PAGE_SCOPE); % logic:iterate id=myCollectionElement name=list Element Value: bean:write name=myCollectionElement / br / /logic:iterate This code results in the following error: [ServletException in:admin/admin_home.jsp] Cannot find bean myCollectionElement in any scope' Any Ideas? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 15, 2002 4:47 PM To: Struts Users Mailing List Subject: Re: Iterate tag Tomcat 4.1.12, issue or no? % SessionUtility su = new SessionUtility(); ArrayList messages = (ArrayList)su.getAttribute(session, HomeConstants.MESSAGE_ARRAY); pageContext.setAttribute(messages, messages); % logic:iterate id=myMessage name=messages Mark Conlin wrote: I am afraid that still does not work. None of these work logic:iterate id=myMessage collection=%=messages% logic:iterate id=myMessage collection=%=messages% logic:iterate id=myMessage collection=messages -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 15, 2002 7:22 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: Re: Iterate tag Tomcat 4.1.12, issue or no? On Sun, 15 Dec 2002 15:39:23 -0500 Mark Conlin [EMAIL PROTECTED] wrote: %= messages.size() % logic:iterate id=myMessage collection=%=messages% %= myMessage.getSubject() % /logic:iterate Try collection=messages (without the scriplets). -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Iterate tag Tomcat 4.1.12, issue or no?
You *do* have a taglib directive for the logic taglib in the page, right? Mark Conlin wrote: Thanks folks, but that does not work either. So I tried the code from the example in the struts developers Guide. It doesn't work either. % java.util.ArrayList list = new java.util.ArrayList(); list.add(First); list.add(Second); list.add(Third); list.add(Fourth); list.add(Fifth); pageContext.setAttribute(list, list, PageContext.PAGE_SCOPE); % logic:iterate id=myCollectionElement name=list Element Value: bean:write name=myCollectionElement / br / /logic:iterate This code results in the following error: [ServletException in:admin/admin_home.jsp] Cannot find bean myCollectionElement in any scope' Any Ideas? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 15, 2002 4:47 PM To: Struts Users Mailing List Subject: Re: Iterate tag Tomcat 4.1.12, issue or no? % SessionUtility su = new SessionUtility(); ArrayList messages = (ArrayList)su.getAttribute(session, HomeConstants.MESSAGE_ARRAY); pageContext.setAttribute(messages, messages); % logic:iterate id=myMessage name=messages Mark Conlin wrote: I am afraid that still does not work. None of these work logic:iterate id=myMessage collection=%=messages% logic:iterate id=myMessage collection=%=messages% logic:iterate id=myMessage collection=messages -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 15, 2002 7:22 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: Re: Iterate tag Tomcat 4.1.12, issue or no? On Sun, 15 Dec 2002 15:39:23 -0500 Mark Conlin [EMAIL PROTECTED] wrote: %= messages.size() % logic:iterate id=myMessage collection=%=messages% %= myMessage.getSubject() % /logic:iterate Try collection=messages (without the scriplets). -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Iterate tag Tomcat 4.1.12, issue or no?
Okay, here is what did it. logic:iterate id=myMess name=messages bean:write name=myMess property=subject/ /logic:iterate So I have to user bean taglib to access a bean inside of an interate tag ? I can't just access it by using %= myMess.getSubject() % ??? I can live with that, I just don't understand why... Mark -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 15, 2002 6:59 PM To: Struts Users Mailing List Subject: Re: Iterate tag Tomcat 4.1.12, issue or no? You *do* have a taglib directive for the logic taglib in the page, right? Mark Conlin wrote: Thanks folks, but that does not work either. So I tried the code from the example in the struts developers Guide. It doesn't work either. % java.util.ArrayList list = new java.util.ArrayList(); list.add(First); list.add(Second); list.add(Third); list.add(Fourth); list.add(Fifth); pageContext.setAttribute(list, list, PageContext.PAGE_SCOPE); % logic:iterate id=myCollectionElement name=list Element Value: bean:write name=myCollectionElement / br / /logic:iterate This code results in the following error: [ServletException in:admin/admin_home.jsp] Cannot find bean myCollectionElement in any scope' Any Ideas? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 15, 2002 4:47 PM To: Struts Users Mailing List Subject: Re: Iterate tag Tomcat 4.1.12, issue or no? % SessionUtility su = new SessionUtility(); ArrayList messages = (ArrayList)su.getAttribute(session, HomeConstants.MESSAGE_ARRAY); pageContext.setAttribute(messages, messages); % logic:iterate id=myMessage name=messages Mark Conlin wrote: I am afraid that still does not work. None of these work logic:iterate id=myMessage collection=%=messages% logic:iterate id=myMessage collection=%=messages% logic:iterate id=myMessage collection=messages -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 15, 2002 7:22 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: Re: Iterate tag Tomcat 4.1.12, issue or no? On Sun, 15 Dec 2002 15:39:23 -0500 Mark Conlin [EMAIL PROTECTED] wrote: %= messages.size() % logic:iterate id=myMessage collection=%=messages% %= myMessage.getSubject() % /logic:iterate Try collection=messages (without the scriplets). -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Iterate tag Tomcat 4.1.12, issue or no?
On Sun, 15 Dec 2002, Mark Conlin wrote: Date: Sun, 15 Dec 2002 19:15:48 -0500 From: Mark Conlin [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: Iterate tag Tomcat 4.1.12, issue or no? Okay, here is what did it. logic:iterate id=myMess name=messages bean:write name=myMess property=subject/ /logic:iterate So I have to user bean taglib to access a bean inside of an interate tag ? I can't just access it by using %= myMess.getSubject() % ??? I can live with that, I just don't understand why... That's actually simple ... the logic:iterate tag does not create a scripting variable. It only stores the current element you are iterating over in the attribute defined by name. Scripting variables are only needed if you're going to use scriptlets or runtime expressions, and in general that (especially scriptlets) is discouraged. NOTE: When you start using JSTL, you'll find that the iteration tags in that library act the same way. Mark Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: multiple file upload
2. I can create file button in loop so it can be added as per requirement. But, in this case the name of file button will be same. I do not think that you can set multiple FormFile using one name. I think it is some sort of limitation of the Strut framework, but you can always provide that functionality yourself. How about loading 1 file at a time, like the way HotMail works. Anyone else have a good way of handling a varible number of files to be uploaded? Regards, Daniel -Original Message- From: Amit Badheka [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 5:34 PM To: Struts Users Mailing List Subject: multiple file upload My requirement is to upload some files, the no of files are not known as the user can add no of files to be attched/uploaded. So, I have two options for doing that - 1. I create the file button dynamically with different name, but in this case how can I add that parameter in form bean. 2. I can create file button in loop so it can be added as per requirement. But, in this case the name of file button will be same. I would like to go for 2nd, as it looks easy to implement. But the problem is that I am not sure if struts can handle such situation where there are multiple file button with same name. Any help will be appreciable. Amit. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [OT] Overloaded setters in JavaBeans
I looked all over for an example. I read the docs and even tried to create an example, but I can not get this to work. I created a BeanInfo and defined my MethodDescriptors, here is the code: public MethodDescriptor[] getMethodDescriptors() { MethodDescriptor rv[] = null; try { Method setEmailString = beanClass.getMethod(setEmail, new Class[] {String.class} ); Method setEmailForm = beanClass.getMethod(setEmail, new Class[] {EmailForm.class} ); Method getEmail = beanClass.getMethod(getEmail, new Class[] {}); Method setName = beanClass.getMethod(setName, new Class[] {String.class}); Method getName = beanClass.getMethod(getName, new Class[] {}); Method[] methods = new Method[] { setEmailString, setEmailForm, getEmail, setName, getName }; rv = new MethodDescriptor[methods.length]; for(int i=0;imethods.length; i++) { rv[i] = new MethodDescriptor(methods[i]); } } catch (NoSuchMethodException e) { e.printStackTrace(); } return rv; } This is all that is in my BeanInfo. The Form only has two properties: String name, EmailForm email. The email property has two setters, one for EmailForm and one for String. I still get the IllegalArgumentException: argument type mismatch. Would someone please fill in the blanks? What am I missing here? Carl -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 14, 2002 2:44 PM To: Struts Users Mailing List Subject: Re: [OT] Overloaded setters in JavaBeans On Fri, 13 Dec 2002, Sri Sankaran wrote: Date: Fri, 13 Dec 2002 13:53:43 -0500 From: Sri Sankaran [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: [OT] Overloaded setters in JavaBeans It is now a well-known fact on this list that if you are trying to access a property using a tag you had better not have an overloaded setter for this property. In other words don't do private String foo; public String getFoo() { return foo; } public void setFoo(String x) { foo = x; } public void setFoo(int i) { foo = + x; } Equally well-known is the reason -- 'tis the JavaBeans specification. So, I went looking. Section 7.1 (Accessor methods) reads Begin quote --- Properties are always accessed via method calls on their owning object. For readable properties there will be a getter method to read the property value. For writable properties there will be a setter method to allow the property value to be updated. --- End quote Section 8.3 (Design Patterns for Properties) reads Begin quote --- By default, we use design patterns to locate properties by looking for methods of the form: public PropertyType getPropertyName(); public void setPropertyName(PropertyType a); If we discover a matching pair of getPropertyName and setPropertyName methods that take and return the same type, then we regard these methods as defining a read-write property whose name will be propertyName. ... If we find only one of these methods, then we regard it as defining either a read-only or a writeonly property called propertyName --- End quote It doesn't say anything about not overloading the accessors. So, why then do we get the error? The implementation of java.beans.Introspector (which is what BeanUtils uses under the covers) has always interpreted the discover a matching pair restriction to mean discover a matching pair and ONLY the matching pair; i.e. no other methods by the same name. Note that you can actually use overloaded setters if you want to, but you're going to have to go to a fair amount of effort. Essentially, you'd need to provide a BeanInfo class for each of your beans that declared what the actual Method implementations of the getter and setter are for each property. Sri Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Could not parse taglib
Hi What could be the Problem for this error. Can anyone suggest me. * Parsing of JSP File '/Sample Hello.jsp' failed: /Sample Hello.jsp(1): Could not parse deployment descriptor: org.xml.sax.SAXParseException: Could not parse taglib, starting at line 2 probably occurred due to an error in /Sample Hello.jsp line 1: %@ taglib uri=/oreillySample.tld prefix=sample % Fri Dec 13 17:18:54 GMT+05:30 2002 *** thanks Regards Shabbir **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts-config.xml
Hi I am new to the Struts, testing some sample applications. we want to implement the struts in our existing project. right now we have almost 50 tables and more than 200 submittion pages. what my concern about the struts is if i have to configure all the form beans and the action mappings the struts-config.xml will become large file. is there any way i can create new configuration file and the action servlet class referes to this config.xml. what i mean is can i divide into different config files. Thanks usha -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Iterate over form bean
Hi, I am trying to iterate over the form bean found in request scope. The property 'x' is of type String[]. jsp:useBean id=bean scope=request class=myForm/ logic:iterate id=item name=bean property=x indexId=index offset=0 length=1 bean:write name=item/ /logic:iterate And I get this error. org.apache.jasper.JasperException: Cannot find bean item in scope null Am I doing something wrong ? Do I have to use the FORM_BEANS_KEY ? Appreciate any ideas. Mohan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Forward to a servlet
Hi folks, In my Struts app, I am using the Action to call the jsp file. In the struts-config.xml, the action tag looks like this, action path=/accounts type=com.mydomain.AccountsAction name=accountsForm validate=false input=/WEB-INF/jsp/AccountsHTML.jsp forward name=accounts path=/WEB-INF/jsp/AccountsHTML.jsp/ /action Because of some deployment issue, I need to pre-compile the jsp files. I successfully use the ANT's jspc tag to compile the all the jsp files to java files, then compile them to java files. However, I cannot make it use the servlet in the forward tag. I tried to do this (AccountsHTML_jsp is class file of the compiled version of AccountsHTML.jsp), but I get 404 page. action path=/accounts type=com.mydomain.AccountsAction name=accountsForm validate=false input=/WEB-INF/jsp/AccountsHTML.jsp forward name=accounts path=/WEB-INF/ui/AccountsHTML_jsp/ /action Would anybody knows how can I make this work? Thanks in advance! Billy Ng
RE: Forward to a servlet
I thought that even with precompiling you would just point the forward at the .jsp file as normal? (Ie: shouldnt need to modify the action stuff in struts-config.xml) -Original Message- From: Billy Ng [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 14:45 To: Struts Users Mailing List Subject: Forward to a servlet Hi folks, In my Struts app, I am using the Action to call the jsp file. In the struts-config.xml, the action tag looks like this, action path=/accounts type=com.mydomain.AccountsAction name=accountsForm validate=false input=/WEB-INF/jsp/AccountsHTML.jsp forward name=accounts path=/WEB-INF/jsp/AccountsHTML.jsp/ /action Because of some deployment issue, I need to pre-compile the jsp files. I successfully use the ANT's jspc tag to compile the all the jsp files to java files, then compile them to java files. However, I cannot make it use the servlet in the forward tag. I tried to do this (AccountsHTML_jsp is class file of the compiled version of AccountsHTML.jsp), but I get 404 page. action path=/accounts type=com.mydomain.AccountsAction name=accountsForm validate=false input=/WEB-INF/jsp/AccountsHTML.jsp forward name=accounts path=/WEB-INF/ui/AccountsHTML_jsp/ /action Would anybody knows how can I make this work? Thanks in advance! Billy Ng -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[ANNOUNCEMENT] Commons Validator 1.0.1 Released
The Commons Validator team is pleased to announce the release of Validator 1.0.1. This release contains only bug fixes - there are no new features in this release. The binary and source distributions are available at: http://jakarta.apache.org/builds/jakarta-commons/release/commons-validator/v1.0.1/ The Validator web site is located at: http://jakarta.apache.org/commons/validator/ -- Martin Cooper -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Forward to a servlet
Interesting! Tell me if I am wrongly interpret your message. Do you mean I should deploy the precompiled jsp files to tomcat/work/standalone/localhost/myApp ? If not, how does the servlet container, tomcat, know I have already precompiled the jsp files when the forward tag points to the jsp files? Billy Ng - Original Message - From: Andrew Hill [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, December 15, 2002 11:05 PM Subject: RE: Forward to a servlet I thought that even with precompiling you would just point the forward at the .jsp file as normal? (Ie: shouldnt need to modify the action stuff in struts-config.xml) -Original Message- From: Billy Ng [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 14:45 To: Struts Users Mailing List Subject: Forward to a servlet Hi folks, In my Struts app, I am using the Action to call the jsp file. In the struts-config.xml, the action tag looks like this, action path=/accounts type=com.mydomain.AccountsAction name=accountsForm validate=false input=/WEB-INF/jsp/AccountsHTML.jsp forward name=accounts path=/WEB-INF/jsp/AccountsHTML.jsp/ /action Because of some deployment issue, I need to pre-compile the jsp files. I successfully use the ANT's jspc tag to compile the all the jsp files to java files, then compile them to java files. However, I cannot make it use the servlet in the forward tag. I tried to do this (AccountsHTML_jsp is class file of the compiled version of AccountsHTML.jsp), but I get 404 page. action path=/accounts type=com.mydomain.AccountsAction name=accountsForm validate=false input=/WEB-INF/jsp/AccountsHTML.jsp forward name=accounts path=/WEB-INF/ui/AccountsHTML_jsp/ /action Would anybody knows how can I make this work? Thanks in advance! Billy Ng -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Forward to a servlet
Billy == Billy Ng [EMAIL PROTECTED] writes: Billy Hi folks, Billy In my Struts app, I am using the Action to call the jsp file. In the struts-config.xml, the action tag looks like this, Billy action path=/accounts Billytype=com.mydomain.AccountsAction Billyname=accountsForm Billyvalidate=false Billyinput=/WEB-INF/jsp/AccountsHTML.jsp Billyforward name=accounts path=/WEB-INF/jsp/AccountsHTML.jsp/ Billy /action Billy Because of some deployment issue, I need to pre-compile the jsp files. I successfully use the ANT's jspc tag to compile the all the jsp files to java files, then compile them to java files. However, I cannot make it use the servlet in the forward tag. I tried to do this (AccountsHTML_jsp is class file of the compiled version of AccountsHTML.jsp), but I get 404 page. Billy action path=/accounts Billytype=com.mydomain.AccountsAction Billyname=accountsForm Billyvalidate=false Billyinput=/WEB-INF/jsp/AccountsHTML.jsp Billyforward name=accounts path=/WEB-INF/ui/AccountsHTML_jsp/ Billy /action Billy Would anybody knows how can I make this work? You don't change your struts-config.xml at all to use precompiled JSP pages. You do have to change your web.xml file, however, to include the servlet mappings for the generated servlets. You also have to include the generated and compiled servlet class files in your WAR file. -- === David M. Karr ; Java/J2EE/XML/Unix/C++ [EMAIL PROTECTED] ; SCJP -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Forward to a servlet
So, should I do this? web.xml = servlet servlet-name AccountHTML_jsp /servlet-name servlet-class com.mydomain.AccountHTML_jsp /servlet-class /servlet servlet-mapping servlet-name AccountHTML_jsp /servlet-name url-pattern /AccountHTML.jsp /url-pattern /servlet-mapping struts-config.xml === action path=/accounts type=com.mydomain.AccountsAction name=accountsForm validate=false input=/WEB-INF/jsp/AccountsHTML.jsp forward name=accounts path=/WEB-INF/jsp/AccountsHTML.jsp/ /action Billy Ng - Original Message - From: David M. Karr [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, December 15, 2002 11:25 PM Subject: Re: Forward to a servlet Billy == Billy Ng [EMAIL PROTECTED] writes: Billy Hi folks, Billy In my Struts app, I am using the Action to call the jsp file. In the struts-config.xml, the action tag looks like this, Billy action path=/accounts Billytype=com.mydomain.AccountsAction Billyname=accountsForm Billyvalidate=false Billyinput=/WEB-INF/jsp/AccountsHTML.jsp Billyforward name=accounts path=/WEB-INF/jsp/AccountsHTML.jsp/ Billy /action Billy Because of some deployment issue, I need to pre-compile the jsp files. I successfully use the ANT's jspc tag to compile the all the jsp files to java files, then compile them to java files. However, I cannot make it use the servlet in the forward tag. I tried to do this (AccountsHTML_jsp is class file of the compiled version of AccountsHTML.jsp), but I get 404 page. Billy action path=/accounts Billytype=com.mydomain.AccountsAction Billyname=accountsForm Billyvalidate=false Billyinput=/WEB-INF/jsp/AccountsHTML.jsp Billyforward name=accounts path=/WEB-INF/ui/AccountsHTML_jsp/ Billy /action Billy Would anybody knows how can I make this work? You don't change your struts-config.xml at all to use precompiled JSP pages. You do have to change your web.xml file, however, to include the servlet mappings for the generated servlets. You also have to include the generated and compiled servlet class files in your WAR file. -- === David M. Karr ; Java/J2EE/XML/Unix/C++ [EMAIL PROTECTED] ; SCJP -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]