Struts2 Application Structure
Having followed this group for a while I know that the generally accepted wisdom is that every page should be handled via an Action. However, I have an application that is probably going to be 70% static pages with 30% Strut-able actions to handle form entry etc etc. This means that I'm going to have an awful lot of action classes that do nothing other than display the next page which feels kludgy. How would people deal with this? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 Application Structure
Not sure where you get the action-per page is the generally accepted norm, but if your page is purely static (i.e. accesses no variables and includes no forms), go straight to the html page. Not only does this save you the JSP compile/post-compile interpretation time it also allows you to move the page onto an separate Apache HTTPD server to improve performance. Al. Roger wrote: Having followed this group for a while I know that the generally accepted wisdom is that every page should be handled via an Action. However, I have an application that is probably going to be 70% static pages with 30% Strut-able actions to handle form entry etc etc. This means that I'm going to have an awful lot of action classes that do nothing other than display the next page which feels kludgy. How would people deal with this? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- Al Sutton W: www.alsutton.com T: twitter.com/alsutton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 Application Structure
Al Sutton wrote: Not sure where you get the action-per page is the generally accepted norm, but if your page is purely static (i.e. accesses no variables and includes no forms), go straight to the html page. Not only does this save you the JSP compile/post-compile interpretation time it also allows you to move the page onto an separate Apache HTTPD server to improve performance. Al. If you can't go down that path, the CodeBehind plugin is exactly what you need. If no action exists but a JSP exists, it invokes a default "do nothing" action so the JSP has access to all the usual Struts2 context and tags. http://struts.apache.org/2.0.11/docs/codebehind-plugin.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 Application Structure
On Saturday 16 August 2008 13:06:19 Al Sutton wrote: > Not sure where you get the action-per page is the generally accepted > norm, but if your page is purely static (i.e. accesses no variables and > includes no forms), go straight to the html page. > > Not only does this save you the JSP compile/post-compile interpretation > time it also allows you to move the page onto an separate Apache HTTPD > server to improve performance. > This is where I think I'm getting confused. How do I seperate my static HTML from my application? Any link http://www.host.com/MyApplication passes directly to Struts 2. Regards > > Roger wrote: > > Having followed this group for a while I know that the generally accepted > > wisdom is that every page should be handled via an Action. However, I > > have an application that is probably going to be 70% static pages with > > 30% Strut-able actions to handle form entry etc etc. This means that I'm > > going to have an awful lot of action classes that do nothing other than > > display the next page which feels kludgy. How would people deal with > > this? > > > > Regards > > > > - > > 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: Struts2 Application Structure
Roger wrote: Any link http://www.host.com/MyApplication passes directly to Struts 2. Only if you're using a strange configuration that says it should. Otherwise http://www.host.com/MyApplication/blah.jsp will be processed in the same way as any other jsp, and http://www.host.com/MyApplication/blah.html will be treated like any other HTML file. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts2 Application Structure
Good Morning Al if you're using Apache you want to config the ajp13 connector to handle any/all struts/jsp/servlet requests so in your %APACHE_HOME%/conf/httpd.conf you'll want to config in ajp13 worker as illustrated here # send all requests ending in .jsp to ajp13 JkMount /*.jsp ajp13 JkMount /jpetstore/* ajp13 JkMount /manager/* ajp13 JKMount /struts2-showcase/* ajp13 JkMount /*.do ajp13 JkMount /*/servlet/ ajp13 JkWorkerProperty worker.list=ajp13 JkWorkerProperty worker.loadbalancer.type=lb JkWorkerProperty worker.loadbalancer.balanced_workers=ajp13 JkWorkerProperty worker.ajp13.type=ajp13 JkWorkerProperty worker.ajp13.host=localhost JkWorkerProperty worker.ajp13.port=8009 HTH! Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. > Date: Sat, 16 Aug 2008 11:55:04 +0100 > From: [EMAIL PROTECTED] > To: user@struts.apache.org > Subject: Re: Struts2 Application Structure > > Roger wrote: > > Any link http://www.host.com/MyApplication passes > > directly to Struts 2. > > > Only if you're using a strange configuration that says it should. > Otherwise http://www.host.com/MyApplication/blah.jsp will be processed > in the same way as any other jsp, and > http://www.host.com/MyApplication/blah.html will be treated like any > other HTML file. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > _ Get ideas on sharing photos from people like you. Find new ways to share. http://www.windowslive.com/explore/photogallery/posts?ocid=TXT_TAGLM_WL_Photo_Gallery_082008
Re: Struts2 Application Structure
So it would appear that your servlet engine is also serving as your primary HTTP stack? running on port 80? If you ran Apache on port 80 instead and used ajp-proxy for your struts requests, then you could just serve all your static resources directly from apache. Now, if you want an integrated security model that covers your Struts and static resources then things can get sticky. It might be worthwhile to serve your static files from your J2EE container if I can easily protect them with a Spring Security configuration, rather than integration with the Apache auth. A very common technique for getting some performance boost is to actually serve your static resources from a different server, so that requests for these (images, stylesheets, etc) don't take up threads on your application server... Rails has a nice switch for doing this. I don't think we have a Struts2 construct for it > On Saturday 16 August 2008 13:06:19 Al Sutton wrote: >> Not sure where you get the action-per page is the generally accepted >> norm, but if your page is purely static (i.e. accesses no variables and >> includes no forms), go straight to the html page. >> >> Not only does this save you the JSP compile/post-compile interpretation >> time it also allows you to move the page onto an separate Apache HTTPD >> server to improve performance. >> > > This is where I think I'm getting confused. How do I seperate my static > HTML > from my application? Any link http://www.host.com/MyApplication passes > directly to Struts 2. > > Regards > >> >> Roger wrote: >> > Having followed this group for a while I know that the generally >> accepted >> > wisdom is that every page should be handled via an Action. However, I >> > have an application that is probably going to be 70% static pages with >> > 30% Strut-able actions to handle form entry etc etc. This means that >> I'm >> > going to have an awful lot of action classes that do nothing other than >> > display the next page which feels kludgy. How would people deal with >> > this? >> > >> > Regards >> > >> > - >> > 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] > > > -- View this message in context: http://www.nabble.com/Struts2-Application-Structure-tp19010085p19025840.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 Application Structure
Annother middle way would be to use the "plain text result" and no separate class attribute like this /intro.html Advantages: -no own Action class (ActionSupport is used) -your static resources don't get processed which should save time -you can still your Security interceptors to check the Authentication and Authorization of the user /Stephan > >> Roger wrote: > >> > Having followed this group for a while I know that the generally > >> accepted > >> > wisdom is that every page should be handled via an Action. However, I > >> > have an application that is probably going to be 70% static pages > with > >> > 30% Strut-able actions to handle form entry etc etc. This means that > >> I'm > >> > going to have an awful lot of action classes that do nothing other > than > >> > display the next page which feels kludgy. How would people deal with > >> > this? > >> > > >> > Regards -- GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen! Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]