Back button after log out should not show secure content.
I know it depends on the browser but this is a best effort thing and am looking for input on my current plan. When user signs on send the current date/time of the client along with credentials and record the offset in the session (if any). All subsequent pages will have a hidden date/time field. On page load check that this field is within a small time frame (30s seconds), if it is not then reload the page. Are there any tools for struts2 or methods other struts programers use to address security after signing out? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: how do i align elements?
Use the simple theme, or override the theme, or use the CSS theme, or override the CSS. Dave On Monday, November 8, 2010, m.harig wrote: > > hi all , > > am designing a user creation page in struts2 , i want to align the > elements as per my requirements , how do i make it? because struts2 itself > align the elements by its own , is there anyway to override it? please any1 > help me > -- > View this message in context: > http://old.nabble.com/how-do-i-align-elements--tp30167828p30167828.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
how do i align elements?
hi all , am designing a user creation page in struts2 , i want to align the elements as per my requirements , how do i make it? because struts2 itself align the elements by its own , is there anyway to override it? please any1 help me -- View this message in context: http://old.nabble.com/how-do-i-align-elements--tp30167828p30167828.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: RE: Have you ever used InputConfig annotation?
On Mon, Nov 8, 2010 at 5:58 PM, Alfredo Manuel Osorio Martinez wrote: >> you can trivially avoid unnecessary prepare calls. > How can I avoid unnecessary prepare calls? I mean how can I avoid the > prepare method won't be called if there are not validation errors. >> De: Dave Newton [mailto:davelnew...@gmail.com] >> Enviado el: Monday, November 08, 2010 10:47 AM >> Don't submit to the same action. Or use prepare{methodName}. Or take >> advantage of it being a MethodFilterInterceptor and configure it to >> run only for the methods you want. Or extend it to default to your >> desired application-specific behavior. Or... Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: RE: Have you ever used InputConfig annotation?
Hello Dave, > you can trivially avoid unnecessary prepare calls. How can I avoid unnecessary prepare calls? I mean how can I avoid the prepare method won't be called if there are not validation errors. Thanks in advance Alfredo Osorio -Mensaje original- De: Dave Newton [mailto:davelnew...@gmail.com] Enviado el: Monday, November 08, 2010 1:30 PM Para: Struts Users Mailing List Asunto: Re: RE: Have you ever used InputConfig annotation? And I'm saying #1 that a testable action is worth a lot and #2 you can trivially avoid unnecessary prepare calls. Dave On Nov 8, 2010 1:54 PM, "Alfredo Manuel Osorio Martinez" < alfredo.oso...@afirme.com> wrote: > Hello Dave and thanks for your response, > > I think I didn't explain myself what I tried to say is whenever you > submit to the action that will process the input data that action's > prepare (or prepareXXX) needs to know how to populate the data needed > for the input result and that's because if validation fails the result > will be the input result (where the data came from) and needs that data > for the repopulation of some controls (list, etc). So whether the > validation passed or failed that logic is always called. So is that the > price you have to pay for a cleaner testable action? My point is the > overhead of calling that method (prepare) for input repopulation even > though sometimes (successful validation) you won't need it. > > Thanks > > Alfredo Osorio > > -Mensaje original- > De: Dave Newton [mailto:davelnew...@gmail.com] > Enviado el: Monday, November 08, 2010 10:47 AM > Para: Struts Users Mailing List > Asunto: Re: Have you ever used InputConfig annotation? > > On Mon, Nov 8, 2010 at 10:07 AM, Alfredo Manuel Osorio Martinez wrote: >> Are you saying that input methods shouldn't have any logic in and just >> return the string of the result. If that's the case where should you >> retrieve those list values? What other alternatives do I have? The > only >> other one that comes to my mind is Preparable and action tag. > > Preparable; I have issues with using tag for that as well; > it puts too much responsibility into the view layer, and means you > *must* integration-test the entire flow, including page rendering, in > order to know if the action works, rather than testing the action in > isolation. > > My acid test for determining what's appropriate in a method: > > Pass: > > Q: What does getInputResultNameDo? > A: Returns the name of the input result. > > Fail: > > Q: What does getInputResultNameDo? > A: It gets the name to use for the input result. And goes to the > database, retrieves a bunch of values, handles persistence-layer > Texceptions, and may populate error messages to return to the user. > >> So in the cases where the validation is going to be >> successful why would you want to retrieve the input lists values or >> other stuff for the input result if you are not even going to use it. >> Isn't that unnecessary overhead? > > Don't submit to the same action. Or use prepare{methodName}. Or take > advantage of it being a MethodFilterInterceptor and configure it to > run only for the methods you want. Or extend it to default to your > desired application-specific behavior. Or... > > Dave > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: RE: Have you ever used InputConfig annotation?
And I'm saying #1 that a testable action is worth a lot and #2 you can trivially avoid unnecessary prepare calls. Dave On Nov 8, 2010 1:54 PM, "Alfredo Manuel Osorio Martinez" < alfredo.oso...@afirme.com> wrote: > Hello Dave and thanks for your response, > > I think I didn't explain myself what I tried to say is whenever you > submit to the action that will process the input data that action's > prepare (or prepareXXX) needs to know how to populate the data needed > for the input result and that's because if validation fails the result > will be the input result (where the data came from) and needs that data > for the repopulation of some controls (list, etc). So whether the > validation passed or failed that logic is always called. So is that the > price you have to pay for a cleaner testable action? My point is the > overhead of calling that method (prepare) for input repopulation even > though sometimes (successful validation) you won't need it. > > Thanks > > Alfredo Osorio > > -Mensaje original- > De: Dave Newton [mailto:davelnew...@gmail.com] > Enviado el: Monday, November 08, 2010 10:47 AM > Para: Struts Users Mailing List > Asunto: Re: Have you ever used InputConfig annotation? > > On Mon, Nov 8, 2010 at 10:07 AM, Alfredo Manuel Osorio Martinez wrote: >> Are you saying that input methods shouldn't have any logic in and just >> return the string of the result. If that's the case where should you >> retrieve those list values? What other alternatives do I have? The > only >> other one that comes to my mind is Preparable and action tag. > > Preparable; I have issues with using tag for that as well; > it puts too much responsibility into the view layer, and means you > *must* integration-test the entire flow, including page rendering, in > order to know if the action works, rather than testing the action in > isolation. > > My acid test for determining what's appropriate in a method: > > Pass: > > Q: What does getInputResultNameDo? > A: Returns the name of the input result. > > Fail: > > Q: What does getInputResultNameDo? > A: It gets the name to use for the input result. And goes to the > database, retrieves a bunch of values, handles persistence-layer > Texceptions, and may populate error messages to return to the user. > >> So in the cases where the validation is going to be >> successful why would you want to retrieve the input lists values or >> other stuff for the input result if you are not even going to use it. >> Isn't that unnecessary overhead? > > Don't submit to the same action. Or use prepare{methodName}. Or take > advantage of it being a MethodFilterInterceptor and configure it to > run only for the methods you want. Or extend it to default to your > desired application-specific behavior. Or... > > Dave > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org >
Form load null in struts1.3.8
I am suing Struts 1.3.8 to write a file upload application. I am not using common-upload plugin. The problem I am having right now is my form bean get null for text field if I try to upload larger file (>200MB) but work fine when i try with less size files. I couldn't understand what's going on Can any one help on this? Thanks in advance. Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Have you ever used InputConfig annotation?
Hello Dave and thanks for your response, I think I didn't explain myself what I tried to say is whenever you submit to the action that will process the input data that action's prepare (or prepareXXX) needs to know how to populate the data needed for the input result and that's because if validation fails the result will be the input result (where the data came from) and needs that data for the repopulation of some controls (list, etc). So whether the validation passed or failed that logic is always called. So is that the price you have to pay for a cleaner testable action? My point is the overhead of calling that method (prepare) for input repopulation even though sometimes (successful validation) you won't need it. Thanks Alfredo Osorio -Mensaje original- De: Dave Newton [mailto:davelnew...@gmail.com] Enviado el: Monday, November 08, 2010 10:47 AM Para: Struts Users Mailing List Asunto: Re: Have you ever used InputConfig annotation? On Mon, Nov 8, 2010 at 10:07 AM, Alfredo Manuel Osorio Martinez wrote: > Are you saying that input methods shouldn't have any logic in and just > return the string of the result. If that's the case where should you > retrieve those list values? What other alternatives do I have? The only > other one that comes to my mind is Preparable and action tag. Preparable; I have issues with using tag for that as well; it puts too much responsibility into the view layer, and means you *must* integration-test the entire flow, including page rendering, in order to know if the action works, rather than testing the action in isolation. My acid test for determining what's appropriate in a method: Pass: Q: What does getInputResultNameDo? A: Returns the name of the input result. Fail: Q: What does getInputResultNameDo? A: It gets the name to use for the input result. And goes to the database, retrieves a bunch of values, handles persistence-layer Texceptions, and may populate error messages to return to the user. > So in the cases where the validation is going to be > successful why would you want to retrieve the input lists values or > other stuff for the input result if you are not even going to use it. > Isn't that unnecessary overhead? Don't submit to the same action. Or use prepare{methodName}. Or take advantage of it being a MethodFilterInterceptor and configure it to run only for the methods you want. Or extend it to default to your desired application-specific behavior. Or... Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts Tiles Problem
Subclass the TilesRequestProcessor instead of the normal one. Dave On Mon, Nov 8, 2010 at 1:08 PM, Andy T wrote: > Hi Lukasz, > > Your identification of the exact cause of the error has helped me to > solve this problem. The problem is here: > > > value="EricEnhancement.util.CustomRequestProcessor"/> > > > For whatever reason the CustomRequestProcessor I was using is not > compatible with the TilesRequestProcessor. When I remove the above > from struts-config.xml everything SEEMS to work as expected. I need > to do a little more work to prove this definitively however. However, > this creates another issue. I was using the CustomRequestProcessor to > redirect to the login page under certain circumstances. Can you > recommend another approach that will accomplish the same thing? > > Thanks so much for your help, > > Andy > > > > On Mon, Nov 8, 2010 at 10:56 AM, Lukasz Lenart > wrote: >> 2010/11/8 Andy T : >>> Hi Lukasz, >>> >>> I have struts-tiles-1.3.8.jar loaded . . . is this what you mean? >> >> Yes, it should be sufficient, could you post your struts config? Below >> is extract from the log you sent me. >> >> FATAL main org.apache.struts.tiles.TilesPlugin - TilesPlugin : >> Specified RequestProcessor not compatible with TilesRequestProcessor >> ERROR main org.apache.struts.action.ActionServlet - Unable to >> initialize Struts ActionServlet due to an unexpected exception or >> error thrown, so marking the servlet as unavailable. Most likely, >> this is due to an incorrect or missing library dependency. >> javax.servlet.ServletException: TilesPlugin : Specified >> RequestProcessor not compatible with TilesRequestProcessor >> at >> org.apache.struts.tiles.TilesPlugin.initRequestProcessorClass(TilesPlugin.java:382) >> at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:137) >> at >> org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:871) >> at org.apache.struts.action.ActionServlet.init(ActionServlet.java:359) >> at javax.servlet.GenericServlet.init(GenericServlet.java:212) >> at >> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139) >> at >> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) >> at >> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956) >> at >> org.apache.catalina.core.StandardContext.start(StandardContext.java:4230) >> at >> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) >> at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) >> at >> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) >> at >> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) >> at >> org.apache.catalina.core.StandardService.start(StandardService.java:448) >> at >> org.apache.catalina.core.StandardServer.start(StandardServer.java:700) >> at org.apache.catalina.startup.Catalina.start(Catalina.java:552) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) >> at java.lang.reflect.Method.invoke(Method.java:599) >> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) >> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433) >> >> >> >> Regards >> -- >> Łukasz >> + 48 606 323 122 http://www.lenart.org.pl/ >> Kapituła Javarsovia 2010 http://javarsovia.pl >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts Tiles Problem
Hi Lukasz, Your identification of the exact cause of the error has helped me to solve this problem. The problem is here: For whatever reason the CustomRequestProcessor I was using is not compatible with the TilesRequestProcessor. When I remove the above from struts-config.xml everything SEEMS to work as expected. I need to do a little more work to prove this definitively however. However, this creates another issue. I was using the CustomRequestProcessor to redirect to the login page under certain circumstances. Can you recommend another approach that will accomplish the same thing? Thanks so much for your help, Andy On Mon, Nov 8, 2010 at 10:56 AM, Lukasz Lenart wrote: > 2010/11/8 Andy T : >> Hi Lukasz, >> >> I have struts-tiles-1.3.8.jar loaded . . . is this what you mean? > > Yes, it should be sufficient, could you post your struts config? Below > is extract from the log you sent me. > > FATAL main org.apache.struts.tiles.TilesPlugin - TilesPlugin : > Specified RequestProcessor not compatible with TilesRequestProcessor > ERROR main org.apache.struts.action.ActionServlet - Unable to > initialize Struts ActionServlet due to an unexpected exception or > error thrown, so marking the servlet as unavailable. Most likely, > this is due to an incorrect or missing library dependency. > javax.servlet.ServletException: TilesPlugin : Specified > RequestProcessor not compatible with TilesRequestProcessor > at > org.apache.struts.tiles.TilesPlugin.initRequestProcessorClass(TilesPlugin.java:382) > at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:137) > at > org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:871) > at org.apache.struts.action.ActionServlet.init(ActionServlet.java:359) > at javax.servlet.GenericServlet.init(GenericServlet.java:212) > at > org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139) > at > org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) > at > org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956) > at > org.apache.catalina.core.StandardContext.start(StandardContext.java:4230) > at > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) > at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) > at > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) > at > org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) > at > org.apache.catalina.core.StandardService.start(StandardService.java:448) > at > org.apache.catalina.core.StandardServer.start(StandardServer.java:700) > at org.apache.catalina.startup.Catalina.start(Catalina.java:552) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) > at java.lang.reflect.Method.invoke(Method.java:599) > at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433) > > > > Regards > -- > Łukasz > + 48 606 323 122 http://www.lenart.org.pl/ > Kapituła Javarsovia 2010 http://javarsovia.pl > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Have you ever used InputConfig annotation?
On Mon, Nov 8, 2010 at 10:07 AM, Alfredo Manuel Osorio Martinez wrote: > Are you saying that input methods shouldn't have any logic in and just > return the string of the result. If that's the case where should you > retrieve those list values? What other alternatives do I have? The only > other one that comes to my mind is Preparable and action tag. Preparable; I have issues with using tag for that as well; it puts too much responsibility into the view layer, and means you *must* integration-test the entire flow, including page rendering, in order to know if the action works, rather than testing the action in isolation. My acid test for determining what's appropriate in a method: Pass: Q: What does getInputResultNameDo? A: Returns the name of the input result. Fail: Q: What does getInputResultNameDo? A: It gets the name to use for the input result. And goes to the database, retrieves a bunch of values, handles persistence-layer Texceptions, and may populate error messages to return to the user. > So in the cases where the validation is going to be > successful why would you want to retrieve the input lists values or > other stuff for the input result if you are not even going to use it. > Isn't that unnecessary overhead? Don't submit to the same action. Or use prepare{methodName}. Or take advantage of it being a MethodFilterInterceptor and configure it to run only for the methods you want. Or extend it to default to your desired application-specific behavior. Or... Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: ONGL & EL expression problem.
>> Is there an unnecessary quotation mark after [titleID]? Try delete it and see if works. If it still not working, My suggestion is: (1)you can implement the search logic in the method [viewPage], and access the search result via a new property. or (2)use a Map instead of a List, so you can retrieve the value by the key or (3)in your action class, add a new [Object Indexed Property] which retrieve the value from your list by the titleID see: http://www.opensymphony.com/ognl/html/LanguageGuide/indexing.html#N101C5 2010/11/9 Mead Lai : > Hello all, > > I have a Action contain a list List, and a String property > titleID, how to display the value from list? > Detail code is here: > //**IndexAction** > public class IndexAction{ > private List list; > private String titleID; > //get & set > public String viewPage() > { > > //#{'a1':'admin','a2':'manager','a3':'member','a4':'user','a5':'guest'}// > simple data list > this.list = BS.getAdminTitleList(); > //set a id > this.titleID = "a5"; > return "view"; > } > } > > //**AdminTitle** > public class AdminTitle{ > private String id; > private String name; > // get & set ... > } > > //**JSP page** > , 'user' > item will be selected. > Now, I want to display the name in plain text way! Get the name by titleID > in the Action > ${list[0].name}, I can get first item from List, and display the name= > 'admin'; > but > ${list[titleID].name} is showing Error on page. > How can I get the "adminTitle.name" on the page, by the certain > "adminTitle.id" > > The following code run fine. > > : > > but > > : > > it show nothing... > What shall I do to pass the "this.titleID" in the Action into the struts2 > > > Regards, > Mead > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts Tiles Problem
2010/11/8 Andy T : > Hi Lukasz, > > I have struts-tiles-1.3.8.jar loaded . . . is this what you mean? Yes, it should be sufficient, could you post your struts config? Below is extract from the log you sent me. FATAL main org.apache.struts.tiles.TilesPlugin - TilesPlugin : Specified RequestProcessor not compatible with TilesRequestProcessor ERROR main org.apache.struts.action.ActionServlet - Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency. javax.servlet.ServletException: TilesPlugin : Specified RequestProcessor not compatible with TilesRequestProcessor at org.apache.struts.tiles.TilesPlugin.initRequestProcessorClass(TilesPlugin.java:382) at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:137) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:871) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:359) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:448) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:552) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433) Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ Kapituła Javarsovia 2010 http://javarsovia.pl - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
ONGL & EL expression problem.
Hello all, I have a Action contain a list List, and a String property titleID, how to display the value from list? Detail code is here: //**IndexAction** public class IndexAction{ private List list; private String titleID; //get & set public String viewPage() { //#{'a1':'admin','a2':'manager','a3':'member','a4':'user','a5':'guest'}// simple data list this.list = BS.getAdminTitleList(); //set a id this.titleID = "a5"; return "view"; } } //**AdminTitle** public class AdminTitle{ private String id; private String name; // get & set ... } //**JSP page** , 'user' item will be selected. Now, I want to display the name in plain text way! Get the name by titleID in the Action ${list[0].name}, I can get first item from List, and display the name= 'admin'; but ${list[titleID].name} is showing Error on page. How can I get the "adminTitle.name" on the page, by the certain "adminTitle.id" The following code run fine. : but : it show nothing... What shall I do to pass the "this.titleID" in the Action into the struts2 Regards, Mead
RE: Have you ever used InputConfig annotation?
Hello, > I still don't believe using a framework-defined method, whose intent is to > return a string result name, to load data is an expressive design. Are you saying that input methods shouldn't have any logic in and just return the string of the result. If that's the case where should you retrieve those list values? What other alternatives do I have? The only other one that comes to my mind is Preparable and action tag. About Preparable interface and input field repopulation there is something that I don't get it. When you submit the form data to the action the Preparable (prepare method) will be executed regardless of validation. So in the cases where the validation is going to be successful why would you want to retrieve the input lists values or other stuff for the input result if you are not even going to use it. Isn't that unnecessary overhead? Alfredo Osorio -Mensaje original- De: Dave Newton [mailto:davelnew...@gmail.com] Enviado el: Saturday, November 06, 2010 6:30 AM Para: Struts Users Mailing List Asunto: Re: Have you ever used InputConfig annotation? I still don't believe using a framework-defined method, whose intent is to return a string result name, to load data is an expressive design. On Nov 6, 2010 2:36 AM, "Maurizio Cucchiara" wrote: > InputConfig works as documented. I reccomend to use Li's suggestion > for inheritance matter. When you need to overwrite base class > behavior, then mark method with InputConfig annotation. > > 2010/11/5 Alfredo Manuel Osorio Martinez : >> Hello, >> >> By looking at DefaultWorkflowInterceptor I saw an annotation that I >> didn't know existed. I am talking about: >> >> com.opensymphony.xwork2.interceptor.annotations.InputConfig >> >> I think it can be used for input repopulation and can be used as an >> alternative to Preparable and . >> >> What surprised me was that there is a little documentation about the use >> of the annotation or examples. >> >> Haver you ever used this one before? >> >> Is it a good idea to use it for input repopulation for example >> collections for selects in case a validation fails? >> >> Thanks >> >> >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > > > -- > Maurizio Cucchiara > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts Tiles Problem
I don't know if this is your problem, per se, but you can't redirect to a tile. A Tile is just an alias/synonym for a jsp rendering. You can only forward to one. Paul On Mon, Nov 8, 2010 at 8:58 AM, Andy T wrote: > Thanks to all who have responded thus far . . . > > I think I forgot to add the Tiles Plugin to my struts-config.xml file. > However when I do this I get "HTTP Status 404 - Servlet action is > not available" . . . > > > > > > > > On Sat, Nov 6, 2010 at 2:47 AM, Lukasz Lenart > wrote: >> 2010/11/5 Rafael Medeiros : >>> How to use plugin-tiles in struts 1.3.8: >> >> Check the documentation >> http://struts.apache.org/1.x/struts-tiles/installation.html >> >> >> Regards >> -- >> Łukasz >> + 48 606 323 122 http://www.lenart.org.pl/ >> Kapituła Javarsovia 2010 http://javarsovia.pl >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts Tiles Problem
Thanks to all who have responded thus far . . . I think I forgot to add the Tiles Plugin to my struts-config.xml file. However when I do this I get "HTTP Status 404 - Servlet action is not available" . . . On Sat, Nov 6, 2010 at 2:47 AM, Lukasz Lenart wrote: > 2010/11/5 Rafael Medeiros : >> How to use plugin-tiles in struts 1.3.8: > > Check the documentation > http://struts.apache.org/1.x/struts-tiles/installation.html > > > Regards > -- > Łukasz > + 48 606 323 122 http://www.lenart.org.pl/ > Kapituła Javarsovia 2010 http://javarsovia.pl > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts Validation with restful URL
Had a look in the soruce for 2.21 AnnotationActionValidatorManager line 226 replaces any / in the action alias with -. So in the example below I would have to give the file the succinct name CreatePortalUserAction-CreatePortalUser-persistCustomer-validation.xml :-) On Thu, Nov 4, 2010 at 12:00 PM, Edward Seager wrote: > Hi all, > > I've just started using Struts 2.21 and I've wired up an action with > RESTfulish way of calling different methods: > > class="com.msi.struts.action.internal.CreatePortalUserAction" method="{1}"> > name="none">/WEB-INF/jsp/internal/createPortalUserHome.jsp > name="newUserPage">/WEB-INF/jsp/internal/createUser.jsp > name="newCustomerPage">/WEB-INF/jsp/internal/createCustomer.jsp > > > so I can process CreatePortalUser/newUserPage or > CreatePortalUser/newCustomerPage within the same action. > > I'm struggling to do separate validation for each method using this > approach though. I think I need a file called > CreatePortalUser-"methodname"-validation.xml for each method, where > "methodname" equals "CreatePortalUser/newUserPage" or " > CreatePortalUser/newCustomerPage". But obviously, I can't include a / > (slash) in the xml's file name. Is there a work around for this? I took a > look at using the Validation annotation on my action class, but it is > deprecated? > > Cheers, > > -- > Eddy Seager > -- Eddy Seager