Re: Integrating a menu system with a struts application
Hello All. Long ago I have one question about Struts Menu: it's support highlight of menu items (example if user in news page then news menu item selected)? I know about using struts-menu since it seems to be the only menu system talked about on this forum. Before I start down a path, I was wondering if anybody else has used another menu system successfully within a struts application other than struts-menu? I was looking into xmenu/xlayser (http://sourceforge.net/projects/xmenu-xlayer) which doesn't seem too bad. Any ideas/advice? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] C - C To unsubscribe, e-mail: [EMAIL PROTECTED] C For additional commands, e-mail: C [EMAIL PROTECTED] -- Best regards, A3Tmailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
???working example of form based jaas auth in struts application???
Has anyone got such a thing? Thanks Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Integrating a menu system with a struts application
I know about using struts-menu since it seems to be the only menu system talked about on this forum. Before I start down a path, I was wondering if anybody else has used another menu system successfully within a struts application other than struts-menu? I was looking into xmenu/xlayser (http://sourceforge.net/projects/xmenu-xlayer) which doesn't seem too bad. Any ideas/advice? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Integrating a menu system with a struts application
I am using struts-menu and fill happy with it. I've just take a look at the xmenu/xplayer you mentionned. It seems that xmenu just display a menu and depends on DHTM/javascript :-(. Struts-menu, however manage the menu fonctionnality : - display the menu - manager rights on menu items (with role or custom rights mamngement) - integrate well with struts. - is fully custumizable (you can subclass/implement PermissionAdapter and MenuDisplayer) So if I except the issue of DHTM and javascript of xmenu, I will say that it depends on your needs. If you just need to display a simple menu in a small web app, xmenu seems OK. However if you need to custumize the display and to display only valid element (according to loogged user's rights), I would suggest struts-menu. BTW, you can use xmenu to display struts menu simply by writing your MenuDisplayer and benefit, in addintion to the LF of xmenu, the struts integration and rights managment of struts menu. I will probably do this for my projects ;-) May be you could suggest to the struts manu developpers to add such displayer to struts-menu. That's just my opinion, I'm currious too to see if there are other (real) alternative to struts-menu. Carl Brad Balmer wrote: I know about using struts-menu since it seems to be the only menu system talked about on this forum. Before I start down a path, I was wondering if anybody else has used another menu system successfully within a struts application other than struts-menu? I was looking into xmenu/xlayser (http://sourceforge.net/projects/xmenu-xlayer) which doesn't seem too bad. Any ideas/advice? Thanks - 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]
Monolithic Struts application to modules cookbook ?
Hi all, We are currently trying to split an existing Struts application into sub-modules, but it seems it is not as easy as it is usually said in the short articles we have found about it. So, I'll try to explain a bit more where we are and what we have done until now. 1. File structure - We have a classical Struts web-app directory structure, with a sub-module as follows: *.jsp /WEB-INF - web.xml - struts-config.xml - tiles-definitions.xml - validator.xml /lib /classes/ourPackage - *.java /scripts /stylesheets /templates /testsubmodule *.jsp /WEB-INF - struts-config.xml /classes/ourPackage - *.java 2. Web.xml -- In our web.xml file, we have added the following xml for the new sub-module: init-param param-nameconfig/testsubmodule/param-name param-value/testsubmodule/WEB-INF/struts-config.xml/param-value /init-param 3. struts-config.xml Then we have added the necessary ActionMapping entries for this sub-module. These definitions are loaded and the mapping is working fine. We only have ActionMapping AND FormBeans really used by this module. Anyway, sometimes determining which FormBeans from your root application is also used by your sub-module is not easy. Duplicating everything can maybe be an easy solution. As far as we have read and from our experience, it seems that RequestProcessor, MessageResources and PlugIns have to be duplicated from the root struts-config.xml file. Is this correct ? We have also created a SwitchAction and a global forward: forward name=gotoTestModule path=/toTestModule.do?page=/bodyTest.jspamp;prefix=/testsubmodule / and action path=/toTestModule type=org.apache.struts.actions.SwitchAction/ As the path attribute is context-relative, there can be a mapping in the root that has the same name as one in the sub-module, i.e. http://myserver/myapp/myaction.do is different from http://myserver/myapp/testsubmodule/myaction.do 4. JSP and Tiles Of course, accessing the stylesheets, scripts and templates from the JSP files in the sub-modules must be context (path) relative too. So one solution is to use a relative path to the files, i.e. ./stylesheets/mycss.css for JSP in the root directory, and ../stylesheets/mycss.css for JSP contained in the testsubmodule directory. Another solution can be to use a BASE tag in order to set the base URI to the application URI. As we are using tiles, this tag can be added in the main tile file. But in this case, it is important to take care about links used in the JSP. But can it lead to unexpected problems ? 5. Java --- Access to Java objects doesn't seem to have problems in the sub-module, wherever they are located (root or sub-module), if the objects in the sub-module are well compiled. 6. Problems --- Seems that our main problems are due to incorrect context. First of all, as we use tiles, and that the main tile template is contained in the root, html:form and calls to mapping.getName() inside the template JSP are NOT in the sub-module context. So the ActionMapping defined in the sub-modules are not known. Well, first of all, we don't use the SwitchAction yet, but will it solve our problem ? Also another solution may be to duplicate the template tile in our sub-module, and use it instead of the one in the root directory. For the moment, we have found in the mailing list archive what I would call a temporary solution, using org.apache.struts.util.RequestUtils.selectModule(testsubmodule,request,application) before any form or call to the mapping Object. Another problem is that we are using a tile with two frames. If the first one is an action from the root directory, and the second frame is an application from the sub-module, and that they are called from a JSP in the sub-module, then we can use the SwitchAction to call both parts. But the problem is that the final context will be the last one called, i.e. the one from the second frame. So if we do some action in the part from the root directory, it doesn't work as it thinks the context is now the one of the sub-module. Well, in general, it seems not easy, and needs more care, to be sure to be in the right context for any action that can be made from one JSP, which can be a headache if you are using multiple tile levels. So, if anyone can help us giving some good pieces of advice regarding our current work, or to complete this text, he/she is welcome. If I've got new information, I'll add it to this thread too. Thanks a lot Alexandre Dumortier = KARMA Project - Development Team __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Guidelines and steps for architecting a struts application
On 02/02/2004 11:20 PM Al Rathon wrote: Hi: I am developing a simple application (basically does CRUD operations on various entities in the application). I want to use the Tiles, Validator also. I would like to know what steps I need to follow to design the architecture. Check out 'MVC' architecture. model-view-controller. There must be a hundred good references on the struts site. As for tiles, it provides an excellent framework for seperating HTML (or whatever mark-up) for a page into modules, which works very well with modern CSS implementation to allow fast and easy design, building redesign of the website interface. Validator automates validation for you - it won't drastically influence your design - just make your development time faster. HTH Adam -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Guidelines and steps for architecting a struts application
Hi: I am developing a simple application (basically does CRUD operations on various entities in the application). I want to use the Tiles, Validator also. I would like to know what steps I need to follow to design the architecture. Thanks. __ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Distribute a Struts Application on CD ??
Just want to know if its possible to run Tomcat/Resin + Java + StrutsApplication from a CD ? If yes, what have i to do ? (Precompile the JSPs i think, but what more ?) Thanx Rouven - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Distribute a Struts Application on CD ??
I'm assuming you're trying to use a Linux Live distro. Perhaps you could test by removing write capabilities to your Tomcat/Resin directories - chmod -R -w /some/dir. If Resin still operates ok, I don't see why it wouldn't work from a live CD. -Ben From: Rouven Gehm [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: [OT] Distribute a Struts Application on CD ?? Date: Thu, 29 Jan 2004 13:00:18 +0100 Just want to know if its possible to run Tomcat/Resin + Java + StrutsApplication from a CD ? If yes, what have i to do ? (Precompile the JSPs i think, but what more ?) Thanx Rouven - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Rethink your business approach for the new year with the helpful tips here. http://special.msn.com/bcentral/prep04.armx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Distribute a Struts Application on CD ??
At 1:00 PM +0100 1/29/04, Rouven Gehm wrote: Just want to know if its possible to run Tomcat/Resin + Java + StrutsApplication from a CD ? If yes, what have i to do ? (Precompile the JSPs i think, but what more ?) You'd have to make sure to configure Tomcat to not want to write sessions to its work directory, or figure out how to set Tomcat's work directory to a writeable directory. Tomcat seems to use the filesystem less than, say, Weblogic or JBoss, but I only use it for local development, not for deployment, so I'm not expert. If you just made your Tomcat directories read-only you could probably do a pretty effective test without burning a bunch of CDs. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining. -- Jef Raskin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AUTO {ICICICARE#005-217-818}[OT] Distribute a Struts Application on CD ??
Dear Sir / Madam,Thank you for writing to [EMAIL PROTECTED] We confirm receipt of your mail and assure you of a response shortly.To help us serve you better, we would request you to kindly mention your account number or any reference number you may have in your future correspondence. Kindly visit our website www.icicibank.com\nri to know more on our products and services. With regards,Customer Care ICICI Bank Limited This communication being sent by ICICI Bank Ltd. is privileged and confidential, and is directed to and for the use of the addressee only. If this message reaches anyone other than the intended recipient, we request the reader not to reproduce, copy, disseminate or in any manner distribute it. We further request such recipient to notify us immediately by return email and delete the original message. ICICI Bank Ltd. does not guarantee the security of any information transmitted electronically and is not liable for the proper, timely and complete transmission thereof. Before opening any attachments please check them for viruses and defects.
AUTO {ICICICARE#005-218-061}[OT] Distribute a Struts Application on CD ??
Dear Sir / Madam,Thank you for writing to [EMAIL PROTECTED] We confirm receipt of your mail and assure you of a response shortly.To help us serve you better, we would request you to kindly mention your account number or any reference number you may have in your future correspondence. Kindly visit our website www.icicibank.com\nri to know more on our products and services. With regards,Customer Care ICICI Bank Limited This communication being sent by ICICI Bank Ltd. is privileged and confidential, and is directed to and for the use of the addressee only. If this message reaches anyone other than the intended recipient, we request the reader not to reproduce, copy, disseminate or in any manner distribute it. We further request such recipient to notify us immediately by return email and delete the original message. ICICI Bank Ltd. does not guarantee the security of any information transmitted electronically and is not liable for the proper, timely and complete transmission thereof. Before opening any attachments please check them for viruses and defects.
AUTO {ICICICARE#005-218-069}[OT] Distribute a Struts Application on CD ??
Dear Sir / Madam,Thank you for writing to [EMAIL PROTECTED] We confirm receipt of your mail and assure you of a response shortly.To help us serve you better, we would request you to kindly mention your account number or any reference number you may have in your future correspondence. Kindly visit our website www.icicibank.com\nri to know more on our products and services. With regards,Customer Care ICICI Bank Limited This communication being sent by ICICI Bank Ltd. is privileged and confidential, and is directed to and for the use of the addressee only. If this message reaches anyone other than the intended recipient, we request the reader not to reproduce, copy, disseminate or in any manner distribute it. We further request such recipient to notify us immediately by return email and delete the original message. ICICI Bank Ltd. does not guarantee the security of any information transmitted electronically and is not liable for the proper, timely and complete transmission thereof. Before opening any attachments please check them for viruses and defects.
Re: AUTO {ICICICARE#005-217-818}[OT] Distribute a Struts Application on CD ??
Can something be done to stop these messages? Thanks, Amy NRI Cell [EMAIL PROTECTED] m To Struts Users Mailing List 01/29/2004 10:17 [EMAIL PROTECTED] AM cc Subject Please respond to AUTO {ICICICARE#005-217-818}[OT] Struts Users Distribute a Struts Application on Mailing List CD ?? [EMAIL PROTECTED] rta.apache.org Dear Sir / Madam,Thank you for writing to [EMAIL PROTECTED] We confirm receipt of your mail and assure you of a response shortly.To help us serve you better, we would request you to kindly mention your account number or any reference number you may have in your future correspondence. Kindly visit our website www.icicibank.com\nri to know more on our products and services. With regards,Customer Care ICICI Bank Limited This communication being sent by ICICI Bank Ltd. is privileged and confidential, and is directed to and for the use of the addressee only. If this message reaches anyone other than the intended recipient, we request the reader not to reproduce, copy, disseminate or in any manner distribute it. We further request such recipient to notify us immediately by return email and delete the original message. ICICI Bank Ltd. does not guarantee the security of any information transmitted electronically and is not liable for the proper, timely and complete transmission thereof. Before opening any attachments please check them for viruses and defects. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: AUTO {ICICICARE#005-217-818}[OT] Distribute a Struts Application on CD ??
+1 on it! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 29, 2004 4:25 PM To: Struts Users Mailing List Subject: Re: AUTO {ICICICARE#005-217-818}[OT] Distribute a Struts Application on CD ?? Can something be done to stop these messages? Thanks, Amy NRI Cell [EMAIL PROTECTED] m To Struts Users Mailing List 01/29/2004 10:17 [EMAIL PROTECTED] AM cc Subject Please respond to AUTO {ICICICARE#005-217-818}[OT] Struts Users Distribute a Struts Application on Mailing List CD ?? [EMAIL PROTECTED] rta.apache.org Dear Sir / Madam,Thank you for writing to [EMAIL PROTECTED] We confirm receipt of your mail and assure you of a response shortly.To help us serve you better, we would request you to kindly mention your account number or any reference number you may have in your future correspondence. Kindly visit our website www.icicibank.com\nri to know more on our products and services. With regards,Customer Care ICICI Bank Limited This communication being sent by ICICI Bank Ltd. is privileged and confidential, and is directed to and for the use of the addressee only. If this message reaches anyone other than the intended recipient, we request the reader not to reproduce, copy, disseminate or in any manner distribute it. We further request such recipient to notify us immediately by return email and delete the original message. ICICI Bank Ltd. does not guarantee the security of any information transmitted electronically and is not liable for the proper, timely and complete transmission thereof. Before opening any attachments please check them for viruses and defects. - 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]
Deploying a struts application (WAR) under ColdFusionMX
Hello all, I am looking to build an add-on web application to a legacy coldfusion application. I have got a prototype working under tomcat and now I want to deploy it to the cf server. It appears that I cannot simply load a war file, nor can I unpack it under cfusionmx\wwwroot. Both apps need to be in the same application server so I can share session data (for single sign-on, database resources, etc.) Has anyone done this? Are there any resources available? The MacroMedia web site suggests (which I also discovered on my own) that you include the struts action servlet definition in the cfusionmx\wwwroot\WEB-INF\web.xml file, but I am concerned about install/uninstall-ability of this web app (there will eventually be as many as 8 of them, and we want to add/remove/upgrade them at will). Eventually, the legacy app may move away from cf in which case we can easily use any app server that suits us. The choices I think I have so far are: 1. Do what a reasonable container would do and manually merge the add-on to the main (cf) application, adding the ActionServlet mapping to the cf web.xml. 2. Drop cf as the web application server and use tomcat, moving the cf servlet pieces into their own web.xml (putting the cf part in its own context/web app). This is effectively the reverse of #1. 3. Figure out a way to make cfusionmx accept the .war or some archive or hierarchy like tomcat would. 4. Figure out a way to make a .car (coldfusion archive) out of my .war I'm looking for help with option #3 (preferred) or #4. Thanks for any pointers, tips, or help, Tim Lucia Ref: http://www.macromedia.com/devnet/mx/coldfusion/articles/struts05.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Off Topic, Problem With Passing Business Bean in Between Classes As Part of My Struts Application
It is not a Struts problem. But, it is the problem I encounter in my Struts application. Please help. I am NOT showing all my code. For example, I skip the DAO interface, and the class that returns a connection object from the connection pool. Nonetheless, those classes are irrelevant to my question. The root of my problem is that I do not know how to pass data that are wrapped in a business bean in between classes. THE JAVA COMPILER DOES NOT RECOGNIZE THE BUSINESS BEAN! 1. I have a controller Servlet that reads the username that is supplied by a visitor of the web site. I want to search the database by the username and get some information about that user; such as userrole, category, etc. A business bean sits in between the controller servlet and the database. Here is the partial code of the controller servlet: [code] // the statement below has problems EditorBean editorData; // Obtain username and password from web tier String username = request.getParameter( username ); // find the editor's information via the business tier // Again, the parameters that I supplied in the method below have problems EditorBean editor = EditorBean.findEditorData( username, editorData ); // wrap the information found in the database in a session object and go on HttpSession session = request.getSession(); editor.setUserrole( request.getParameter( userrole ) ); editor.setCategory( request.getParameter( category ) ); session.setAttribute( editor, editor ); [/code] 2. I have this EditorBean class. This EditorBean is a business bean. I am struggling with how the EditorBean pass the data in between the controller and the database. [code] import org.apache.artimus.logon.dao.*; public class EditorBean { private String username; private String userrole; private String category; EditorDAO ed = new MySQLEditorDAO(); public EditorBean() {} public EditorBean( String username, String userrole, String category ) { setUsername( username ); setUserrole( userrole ); setCategory( category ); } public String getUsername(){ return username; } public void setUsername( String username ) { this.username = username; } public String getUserrole(){ return userrole; } public void setUserrole( String userrole ) { this.userrole = userrole; } public String getcategory(){ return category; } public void setCategory( String category ) { this.category = category; } // the parameters in the method below have problems public EditorBean findEditorData( String username, EditorBean editorData ) { // What do I do here? ed.findEditor( String username, ?? ); // I am not sure what to return here return ?; } } [/code] 3. Here is my data access class: [code] import java.io.IOException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; import java.sql.SQLException; import org.apache.artimus.logon.exceptions.EditorDAOSysException; import org.apache.artimus.ConnectionPool.DBConnection; public class MySQLEditorDAO implements EditorDAO{ // the parameters of the method below have problems public EditorBean findEditor( String username, ?? ) throws EditorDAOSysException { Connection conn = null; Statement stmt = null; ResultSet rs = null; try { conn = DBConnection.getDBConnection(); stmt = conn.createStatement(); String query = SELECT user_role, journal_category FROM members WHERE user_name = ' + username + '; rs = stmt.executeQuery( query ); if (rs.next()) { // something is wrong in returning the information about that editor return new EditorBean( username, rs.getString( user_role ), rs.getString( journal_category) ); } else { System.out.println( invalid user name ); return null; } } catch (SQLException se) { throw new EditorDAOSysException(SQLException: + se.getMessage()); } finally { if ( conn != null ) { try { rs.close(); rs = null; stmt.close(); stmt = null; conn.close(); } catch( SQLException sqlEx ) { System.out.println( Problem occurs while closing + sqlEx ); } conn = null; } } } } [/code] __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
struts application with frames: top, side menus and main screen
Hi ! Has anyone found sample STRUTS application and/or documentation on the net that uses frames ? I would like to build the application with top menu, side menu and main screen. Thanks ! Neso - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard
RE: struts application with frames: top, side menus and main screen
I'm using frames w/Struts, what specifically do you want to know? There's not anything special you have to do with frames and Struts as far as I know. -Original Message- From: neso m [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 3:02 PM To: [EMAIL PROTECTED] Subject: struts application with frames: top, side menus and main screen Hi ! Has anyone found sample STRUTS application and/or documentation on the net that uses frames ? I would like to build the application with top menu, side menu and main screen. Thanks ! Neso - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts application with frames: top, side menus and main screen
I am currently working on a site that is frame based for each of the pages that are to be displayed I reference the action mapping for each of the src tags. -Original Message- From: neso m [mailto:[EMAIL PROTECTED] Sent: Thu 11/13/2003 2:02 PM To: [EMAIL PROTECTED] Cc: Subject: struts application with frames: top, side menus and main screen Hi ! Has anyone found sample STRUTS application and/or documentation on the net that uses frames ? I would like to build the application with top menu, side menu and main screen. Thanks ! Neso - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts application with frames: top, side menus and main screen
...I need to put dynamic support for different languages. Display every page in English/French, back and forth also top and side menu changes every time I click French or English. As I change through my top menu i would like my side menu to change, as well as my main page, for example when I click on administration administration menu pops up on the left hand side and main page populated with welcome to the admin section. Similar thing with publishing section, and any other on topmenu etc.I have little prototype with heavu use of JavaScript which I am not very happy with. Where tough to maintain. I beleive that there is a better way to do this utilizing some Struts tags instead of using bare JavaScript. I was wondering if there is anyone with anything to share that would get me going here. Thanks ! Neso David Liles [EMAIL PROTECTED] wrote: I am currently working on a site that is frame based for each of the pages that are to be displayed I reference the action mapping for each of the src tags. -Original Message- From: neso m [mailto:[EMAIL PROTECTED] Sent: Thu 11/13/2003 2:02 PM To: [EMAIL PROTECTED] Cc: Subject: struts application with frames: top, side menus and main screen Hi ! Has anyone found sample STRUTS application and/or documentation on the net that uses frames ? I would like to build the application with top menu, side menu and main screen. Thanks ! Neso - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard
RE: struts application with frames: top, side menus and main screen
There are 100 ways to peel an onion one way to peel it is to attach a parameter to each of your links and in your action mapping determin which pages should be displayed based on the detected parameter As for displaying different pages in your different frame windows... you control that with your targets. -Original Message- From: neso m [mailto:[EMAIL PROTECTED] Sent: Thu 11/13/2003 2:27 PM To: Struts Users Mailing List Cc: Subject: RE: struts application with frames: top, side menus and main screen ...I need to put dynamic support for different languages. Display every page in English/French, back and forth also top and side menu changes every time I click French or English. As I change through my top menu i would like my side menu to change, as well as my main page, for example when I click on administration administration menu pops up on the left hand side and main page populated with welcome to the admin section. Similar thing with publishing section, and any other on topmenu etc.I have little prototype with heavu use of JavaScript which I am not very happy with. Where tough to maintain. I beleive that there is a better way to do this utilizing some Struts tags instead of using bare JavaScript. I was wondering if there is anyone with anything to share that would get me going here. Thanks ! Neso David Liles [EMAIL PROTECTED] wrote: I am currently working on a site that is frame based for each of the pages that are to be displayed I reference the action mapping for each of the src tags. -Original Message- From: neso m [mailto:[EMAIL PROTECTED] Sent: Thu 11/13/2003 2:02 PM To: [EMAIL PROTECTED] Cc: Subject: struts application with frames: top, side menus and main screen Hi ! Has anyone found sample STRUTS application and/or documentation on the net that uses frames ? I would like to build the application with top menu, side menu and main screen. Thanks ! Neso - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts application with frames: top, side menus and main screen
Thanks for your answers. Do you have any documents, how to, etc to point me too? Neso David Liles [EMAIL PROTECTED] wrote: There are 100 ways to peel an onion one way to peel it is to attach a parameter to each of your links and in your action mapping determin which pages should be displayed based on the detected parameter As for displaying different pages in your different frame windows... you control that with your targets. -Original Message- From: neso m [mailto:[EMAIL PROTECTED] Sent: Thu 11/13/2003 2:27 PM To: Struts Users Mailing List Cc: Subject: RE: struts application with frames: top, side menus and main screen ...I need to put dynamic support for different languages. Display every page in English/French, back and forth also top and side menu changes every time I click French or English. As I change through my top menu i would like my side menu to change, as well as my main page, for example when I click on administration administration menu pops up on the left hand side and main page populated with welcome to the admin section. Similar thing with publishing section, and any other on topmenu etc.I have little prototype with heavu use of JavaScript which I am not very happy with. Where tough to maintain. I beleive that there is a better way to do this utilizing some Struts tags instead of using bare JavaScript. I was wondering if there is anyone with anything to share that would get me going here. Thanks ! Neso David Liles wrote: I am currently working on a site that is frame based for each of the pages that are to be displayed I reference the action mapping for each of the src tags. -Original Message- From: neso m [mailto:[EMAIL PROTECTED] Sent: Thu 11/13/2003 2:02 PM To: [EMAIL PROTECTED] Cc: Subject: struts application with frames: top, side menus and main screen Hi ! Has anyone found sample STRUTS application and/or documentation on the net that uses frames ? I would like to build the application with top menu, side menu and main screen. Thanks ! Neso - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard
RE: struts application with frames: top, side menus and main screen
Here is an example frame layout that maps to actions for each of the pages to be displayed... frameset rows=80,* cols=* frameborder=no border=0 framespacing=0 frame src=/header.do name=headerFrame scrolling=no noresize frameset cols=120,* frameborder=no border=0 framespacing=0 frame src=/nav.do name=navFrame scrolling=no noresize frame src=/main.do name=mainFrame /frameset /frameset As for href links... I've used the following: html:link page=javascript:nav('parameter');example 1/html:link JavaScript that executes the href notice that the line (paraent.mainFrame.location) identifies which frame window to display the returned page // JavaScript Document function nav(id) { var URL = /Display.do?item= + id + site=public parent.mainFrame.location = URL; } Hope this helps -Original Message- From: neso m [mailto:[EMAIL PROTECTED] Sent: Thu 11/13/2003 2:49 PM To: Struts Users Mailing List Cc: Subject: RE: struts application with frames: top, side menus and main screen Thanks for your answers. Do you have any documents, how to, etc to point me too? Neso David Liles [EMAIL PROTECTED] wrote: There are 100 ways to peel an onion one way to peel it is to attach a parameter to each of your links and in your action mapping determin which pages should be displayed based on the detected parameter As for displaying different pages in your different frame windows... you control that with your targets. -Original Message- From: neso m [mailto:[EMAIL PROTECTED] Sent: Thu 11/13/2003 2:27 PM To: Struts Users Mailing List Cc: Subject: RE: struts application with frames: top, side menus and main screen ...I need to put dynamic support for different languages. Display every page in English/French, back and forth also top and side menu changes every time I click French or English. As I change through my top menu i would like my side menu to change, as well as my main page, for example when I click on administration administration menu pops up on the left hand side and main page populated with welcome to the admin section. Similar thing with publishing section, and any other on topmenu etc.I have little prototype with heavu use of JavaScript which I am not very happy with. Where tough to maintain. I beleive that there is a better way to do this utilizing some Struts tags instead of using bare JavaScript. I was wondering if there is anyone with anything to share that would get me going here. Thanks ! Neso David Liles wrote: I am currently working on a site that is frame based for each of the pages that are to be displayed I reference the action mapping for each of the src tags. -Original Message- From: neso m [mailto:[EMAIL PROTECTED] Sent: Thu 11/13/2003 2:02 PM To: [EMAIL PROTECTED] Cc: Subject: struts application with frames: top, side menus and main screen Hi ! Has anyone found sample STRUTS application and/or documentation on the net that uses frames ? I would like to build the application with top menu, side menu and main screen. Thanks ! Neso - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Deploying struts application on iplanet 6.0 or 4.0
Hello James, I have dowloaded the iplanet 6.0 service pack 4.0 (web server) but I am still unable to deploy the struts application can anybody tell me what all jars I need to keep in the classpath?? Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) James Mitchell [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] e.org cc: (bcc: alok.garg/Polaris) Subject: RE: Deploying struts application on iplanet 6.0 or 4.0 11/01/03 02:43 AM Please respond to Struts Users Mailing List You will need to upgrade to 6.1. If I were you, I wouldn't waste my time trying anything less. If your customer/boss says they can't or won't, tell them that they will spend more time trying to make it work then they ever would have if they had just upgraded...trust me! -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (c) 770.822.3359 (h) AIM:jmitchtx -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, October 31, 2003 4:06 PM To: Struts Users Mailing List Subject: RE: Deploying struts application on iplanet 6.0 or 4.0 I want to deploy my Struts application which is running in Tomcat in iplanet server version 6.0. with no service packs Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) James Mitchell [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] e.org cc: (bcc: alok.garg/Polaris) Subject: RE: Deploying struts application on iplanet 6.0 or 4.0 11/01/03 12:40 AM Please respond to Struts Users Mailing List You're welcome in advance. Now, what's your question? -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (c) 770.822.3359 (h) AIM:jmitchtx -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, October 31, 2003 1:01 PM To: [EMAIL PROTECTED] Subject: Deploying struts application on iplanet 6.0 or 4.0 Hello , I want to deploy the struts application on iplanet 6.0 or 4.0. Thanking you in advance... Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) - 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] This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit Us at http://www.polaris.co.in - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Deploying struts application on iplanet 6.0 or 4.0
That's because 6.0 != 6.1 -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (c) 770.822.3359 (h) AIM:jmitchtx -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 4:51 AM To: Struts Users Mailing List Subject: RE: Deploying struts application on iplanet 6.0 or 4.0 Hello James, I have dowloaded the iplanet 6.0 service pack 4.0 (web server) but I am still unable to deploy the struts application can anybody tell me what all jars I need to keep in the classpath?? Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) James Mitchell [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] e.org cc: (bcc: alok.garg/Polaris) Subject: RE: Deploying struts application on iplanet 6.0 or 4.0 11/01/03 02:43 AM Please respond to Struts Users Mailing List You will need to upgrade to 6.1. If I were you, I wouldn't waste my time trying anything less. If your customer/boss says they can't or won't, tell them that they will spend more time trying to make it work then they ever would have if they had just upgraded...trust me! -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (c) 770.822.3359 (h) AIM:jmitchtx -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, October 31, 2003 4:06 PM To: Struts Users Mailing List Subject: RE: Deploying struts application on iplanet 6.0 or 4.0 I want to deploy my Struts application which is running in Tomcat in iplanet server version 6.0. with no service packs Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) James Mitchell [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] e.org cc: (bcc: alok.garg/Polaris) Subject: RE: Deploying struts application on iplanet 6.0 or 4.0 11/01/03 12:40 AM Please respond to Struts Users Mailing List You're welcome in advance. Now, what's your question? -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (c) 770.822.3359 (h) AIM:jmitchtx -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, October 31, 2003 1:01 PM To: [EMAIL PROTECTED] Subject: Deploying struts application on iplanet 6.0 or 4.0 Hello , I want to deploy the struts application on iplanet 6.0 or 4.0. Thanking you in advance... Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) - 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]
Deploying struts application on iplanet 6.0 or 4.0
Hello , I want to deploy the struts application on iplanet 6.0 or 4.0. Thanking you in advance... Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit Us at http://www.polaris.co.in - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Deploying struts application on iplanet 6.0 or 4.0
You're welcome in advance. Now, what's your question? -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (c) 770.822.3359 (h) AIM:jmitchtx -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, October 31, 2003 1:01 PM To: [EMAIL PROTECTED] Subject: Deploying struts application on iplanet 6.0 or 4.0 Hello , I want to deploy the struts application on iplanet 6.0 or 4.0. Thanking you in advance... Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Deploying struts application on iplanet 6.0 or 4.0
I want to deploy my Struts application which is running in Tomcat in iplanet server version 6.0. with no service packs Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) James Mitchell [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] e.org cc: (bcc: alok.garg/Polaris) Subject: RE: Deploying struts application on iplanet 6.0 or 4.0 11/01/03 12:40 AM Please respond to Struts Users Mailing List You're welcome in advance. Now, what's your question? -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (c) 770.822.3359 (h) AIM:jmitchtx -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, October 31, 2003 1:01 PM To: [EMAIL PROTECTED] Subject: Deploying struts application on iplanet 6.0 or 4.0 Hello , I want to deploy the struts application on iplanet 6.0 or 4.0. Thanking you in advance... Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit Us at http://www.polaris.co.in - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Deploying struts application on iplanet 6.0 or 4.0
You will need to upgrade to 6.1. If I were you, I wouldn't waste my time trying anything less. If your customer/boss says they can't or won't, tell them that they will spend more time trying to make it work then they ever would have if they had just upgraded...trust me! -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (c) 770.822.3359 (h) AIM:jmitchtx -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, October 31, 2003 4:06 PM To: Struts Users Mailing List Subject: RE: Deploying struts application on iplanet 6.0 or 4.0 I want to deploy my Struts application which is running in Tomcat in iplanet server version 6.0. with no service packs Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) James Mitchell [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] e.org cc: (bcc: alok.garg/Polaris) Subject: RE: Deploying struts application on iplanet 6.0 or 4.0 11/01/03 12:40 AM Please respond to Struts Users Mailing List You're welcome in advance. Now, what's your question? -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (c) 770.822.3359 (h) AIM:jmitchtx -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, October 31, 2003 1:01 PM To: [EMAIL PROTECTED] Subject: Deploying struts application on iplanet 6.0 or 4.0 Hello , I want to deploy the struts application on iplanet 6.0 or 4.0. Thanking you in advance... Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) - 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]
Modular Struts Application - Cross-WebApp Tiles? Best practices?
Hello, does anyone of you have experience with the following: I try to create a modular webapp/website that (for example) might consist of a forum, a guestbook and other modules. Granted that I had a folder greatsite in the webapps folder of my servlet container, and make my domain point to this folder, I would usually create a sub folder called forum to make it available under http://mydomain.eu/forum. If I did that, the disadvantage would be obvious: For example, in order to install new classes for the forum, I would have to restart the whole greatsite web application to make my servlet container recognize the new classes. (Granted that class reloading were impossible) Is there a smooth way to avoid this? My first guess was to install separate web applications (for my forum and guestbook) in the servlet container (Tomcat or Enhydra). Tell me if I'm wrong, but this would prevent me from using the Struts' Tiles framework across the independent web applications, wouldn't it? Maybe Tiles can even be used between independent web apps, maybe it is a simple configuration problem that can be solved easily, but I didn't figure out a solution yet. I hope I was able to explain my concern comprehensibly, please let me know how to come closer to my objective. :-) I'm very much looking forward to your answers. Thank you in advance. Best regards, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Planning Struts Application Development
[EMAIL PROTECTED] wrote: Hi I thought I might add a query about performance related issues when reflection is used. This might be odd but many teams in my company have started using Struts without ActionForms. They use Actions and pick up the parameters from the request object. Are there any benchmarks that prove reflection doesn't impose a big overhead ? Well, published benchmarks are like bikinis. They seem to reveal a lot but keep the best bits under wraps. :) The best advice would be for you to cobble up the same workflow using ActionForms and then use JMeter to run your own benchmarks. That's the only way you will *know* whether it's a problem for you or not, and exactly how severe it is for *you* on *your* equipment. Mileage can vary depending on the underlying hardware platform and network configuration. Anyway, here's a thread that speaks to your original question: http://www.mail-archive.com/[EMAIL PROTECTED]/msg80042.html Secondly one team is facing problems with multiple master-detail layers. We have used indexed properties for one level of master-detail . What about multiple levels ?Any suggestions ? I generally continue to nest detail within detail to whatever arbitrary layer is needed. Usually, the trick is to have a very clever JavaBean and rather stupid presentation code. Things like this get very hairy if you are trying to do too much on the page. Think in terms of a JavaBean that could be used to produce a plain-text, PDF, or HTML report, and then use tags to render the *JavaBean* in HTML, without knowing to much about the logic of the underlying report. HTH, Ted. -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Planning Struts Application Development
What's more, the on-line help on the Expresso list is probably the best I have ever encountered.. In fact, I suspect the lead developer of the project is a vampire so he never sleeps..;) You can also pay a pretty nominal amount for prime support - and if you contribute to their open-source project, I believe you can even qualify for free support!! Re. your earlier question, here's my 1 cent: we have been working on a long (2+ years and counting) project. Version 1 involved a lot of home-grown servlets and jsps. Version 2 involved building additional functionality and was written in a combination of servlets and Struts (due to differing degrees of familiarity of the developers with Struts). Version 3 (currently being developed) is written entirely in Struts. I can tell you that every time the clients either notice a bug or want to change or add behaviour, we give a collective groan if it has anything to do with non-Struts code! But if it is the later code, we just breeze through it..:) Regards, Geeta Andrew Hill wrote: You might want to take a look at Jcorporates OpenSource Expresso framework. http://www.jcorporate.com/ Ive not used it myself yet so cant give you an experienced opinion, but it uses struts and provides whole bunch of other goodies which migh help you get a head start on your project. -Original Message- From: Lauri Jutila [mailto:[EMAIL PROTECTED] Sent: Wednesday, 29 October 2003 07:04 To: [EMAIL PROTECTED] Subject: Planning Struts Application Development Hello folks, I'm engaging in a web development project and my team is looking at Struts as a primary framework candidate for the application. Before we make final decision, I'd be glad to hear some commentary and experiences from real-world Struts users. Our project goal is to create an application which is leaning a little towards web-based group-ware applications in terms of feature set. No, we are not creating e-mail/calendar/task-list/foobar portal, but our app will include some of the basic group-ware app features and share quite many characteristics (different types of calendars come to mind). We would like our application to support at least hundreds of concurrent users. What kind of issues does this arise in terms of hardware and software/application configurations? How many users per app server would be feasible and how to handle multi-server environment gracefully? How is caching supported or implemented in Struts? What do you think are the fundamental issues to focus on design development? And if you think, based on my very poor description of requirements, that Struts may not be the right framework, what are the alternatives? Best regards, -- Lauri Jutila [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: Planning Struts Application Development
You may find it interesting to have a look at http://www.mvc2frameworks.org, a research site which has a BOF presentation we made at J1 on frameworks and a spreadsheet which details what/where frameworks focus. It explains how architectural frameworks (i.e. Expresso) are a superset of presentation framework features, (i.e. Struts) and details the features of each; as well as compares frameworks (as of June this year). Also have a look at http://www.waferproject.org/ which also compares frameworks. -- Sandra Cann http://www.jcorporate.com Open Standards based Java components Our separation from each other is an optical illusion of consciousness. (Albert Einstein) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Planning Struts Application Development
Lauri There is assurance in using the stable, defacto standard Struts for your application, ensuring longevity of your investment. As also mentioned by some folks here, Expresso extends Struts with those pieces such as caching and much more. Using Struts/Expresso we have a number of web-based group-ware applications including forum (oss), polling (oss), faq and content management. We also have a calendar application in development - let me know if you want to know more. And you will find good support from our large community along the way. We have fortune sites with hundreds of concurrent users using Expresso so you are in good hands there too. -- Sandra Cann http://www.jcorporate.com Open Standards based Java components Our separation from each other is an optical illusion of consciousness. (Albert Einstein) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Planning Struts Application Development
Hello folks, I'm engaging in a web development project and my team is looking at Struts as a primary framework candidate for the application. Before we make final decision, I'd be glad to hear some commentary and experiences from real-world Struts users. Our project goal is to create an application which is leaning a little towards web-based group-ware applications in terms of feature set. No, we are not creating e-mail/calendar/task-list/foobar portal, but our app will include some of the basic group-ware app features and share quite many characteristics (different types of calendars come to mind). We would like our application to support at least hundreds of concurrent users. What kind of issues does this arise in terms of hardware and software/application configurations? How many users per app server would be feasible and how to handle multi-server environment gracefully? How is caching supported or implemented in Struts? What do you think are the fundamental issues to focus on design development? And if you think, based on my very poor description of requirements, that Struts may not be the right framework, what are the alternatives? Best regards, -- Lauri Jutila [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Planning Struts Application Development
Lauri, I'm still learning Struts myself, so I won't comment on its scalability or give an opinion of it. WebWork at OpenSymphony.com is an alternative MVC to consider. Nick Faiz -Original Message- From: Lauri Jutila [mailto:[EMAIL PROTECTED] Sent: Wednesday, 29 October 2003 10:04 AM To: [EMAIL PROTECTED] Subject: Planning Struts Application Development Hello folks, I'm engaging in a web development project and my team is looking at Struts as a primary framework candidate for the application. Before we make final decision, I'd be glad to hear some commentary and experiences from real-world Struts users. Our project goal is to create an application which is leaning a little towards web-based group-ware applications in terms of feature set. No, we are not creating e-mail/calendar/task-list/foobar portal, but our app will include some of the basic group-ware app features and share quite many characteristics (different types of calendars come to mind). We would like our application to support at least hundreds of concurrent users. What kind of issues does this arise in terms of hardware and software/application configurations? How many users per app server would be feasible and how to handle multi-server environment gracefully? How is caching supported or implemented in Struts? What do you think are the fundamental issues to focus on design development? And if you think, based on my very poor description of requirements, that Struts may not be the right framework, what are the alternatives? Best regards, -- Lauri Jutila [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: Planning Struts Application Development
-Original Message- From: Lauri Jutila [mailto:[EMAIL PROTECTED] Sent: Wednesday, 29 October 2003 10:04 AM To: [EMAIL PROTECTED] Subject: Planning Struts Application Development Hello folks, I'm engaging in a web development project and my team is looking at Struts as a primary framework candidate for the application. Before we make final decision, I'd be glad to hear some commentary and experiences from real-world Struts users. I've been involved in several real-world projects that use Struts. Our project goal is to create an application which is leaning a little towards web-based group-ware applications in terms of feature set. No, we are not creating e-mail/calendar/task-list/foobar portal, but our app will include some of the basic group-ware app features and share quite many characteristics (different types of calendars come to mind). We would like our application to support at least hundreds of concurrent users. What kind of issues does this arise in terms of hardware and software/application configurations? How many users per app server would be feasible and how to handle multi-server environment gracefully? How is caching supported or implemented in Struts? One of the projects takes several million hits a week with thousands of concurrent users. Struts handles it fine. No, caching is not implemented in Struts. Struts at it's core is a Page Controller (see Patterns for Enterprise Application Architecture by Martin Fowler for a good description) with some very handy extras. The other layers (data access etc) are provided by other technologies (see http://jakarta.apache.org/struts/userGuide/preface.html#layers), some of which provide caching. What do you think are the fundamental issues to focus on design development? And if you think, based on my very poor description of requirements, that Struts may not be the right framework, what are the alternatives? Struts is definitely the framework to use, although there are some other alternatives. I would recommend giving your team a week or two to play with Struts (and any other new technologies you choose) before you throw them into the thick of it. I often hear people complaining that Struts is confusing (with all the configuration files etc), but once you get over the initial shock it's well worth it. You'll never want to go back. I would recommend reading the Patterns for Enterprise Application Architecture book if you need to brush up on any of this. It's an excellent resource and a very informative read. Best regards, -- Lauri Jutila [EMAIL PROTECTED] Cheers, Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Planning Struts Application Development
Lauri Jutila wrote: We would like our application to support at least hundreds of concurrent users. What kind of issues does this arise in terms of hardware and software/application configurations? How many users per app server would be feasible 2,000 concurent users to 4,000 concurent users per server is what I normaly get (tested using OpenSTA on 1U NewISys 2100 class machine - about $4,000 US with Resin app. server and J:Rockit Java VM) and how to handle multi-server environment gracefully? I use sticky bit at CISCO (there are other ways to sticky bit) so users allways go to same server for the session. (In unlikely case server dies, users get a new session on another box... I do not complicate with replication, since each save gets saved to db). Most DAO's have distributed caching (Hibrenate, iBatis) and iBatis.com dblayer's distributed caching for flushing works great. iMagine you are caching some db content, and one of the servers update it. It's auto flushed and you get a new cache! How is caching supported or implemented in Struts? I assume data caching? Data caching is done in the Model layer by the DAO. Doing caching in V or C is ... not Struts. As far as caching of content by Akamai... a portal I think assumes dynamic content, so you can't realy use them. (That is only for MS SharePoint users... SLOW) What do you think are the fundamental issues to focus on design development? 3 things are key: 1. Requriments 2. Requriments 3. Requriments And if you think, based on my very poor description of requirements, that Struts may not be the right framework, what are the alternatives? Struts is the most popular framework in production and has excelent support. It is default and known, other ones might add risk. Consider http://www.infonoia.com/en/basicportal.jsp, it is open source portal, they are in Europe (a distributor of bP) and might be able to assist with an example. (They are about to deploy 900 CPU portal) hth, -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Planning Struts Application Development
Hi I thought I might add a query about performance related issues when reflection is used. This might be odd but many teams in my company have started using Struts without ActionForms. They use Actions and pick up the parameters from the request object. Are there any benchmarks that prove reflection doesn't impose a big overhead ? Secondly one team is facing problems with multiple master-detail layers. We have used indexed properties for one level of master-detail . What about multiple levels ?Any suggestions ? Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Planning Struts Application Development
remember that struts is just a bunch of java classes, so any scalability and hardware questions can really be boiled down to is java performant enough for our application? struts is really just a layer between your business objects and the web browser. Any caching should happen between the business objects and the database. If it is a non trivial web application, and it will be written in java, then you should use Struts. If you don't, the developers will just end up writing (and debugging) what is already done for them in Struts. Struts is the de facto standard and lots of people have skills with it in the marketplace. There are plenty of books covering struts, so learning it is no problem. The mailing lists are great. I recommend Husted's Struts in Action or O'Reilly Programming Struts (2nd). The downside is that some of the nomenclature in the framework is tricky/fuzzy and it can take a little while to get the hang of Struts. We would like our application to support at least hundreds of concurrent users. What kind of issues does this arise in terms of hardware and software/application configurations? How many users per app server would be feasible and how to handle multi-server environment gracefully? How is caching supported or implemented in Struts? What do you think are the fundamental issues to focus on design development? And if you think, based on my very poor description of requirements, that Struts may not be the right framework, what are the alternatives? - Do you Yahoo!? Exclusive Video Premiere - Britney Spears
RE: Planning Struts Application Development
If it's any help, I have been working on a rather large application which was primarily written using 'plain' JSP and this is exactly what happened. The developers ended up making endless, buggy, incomplete variants of things that exist in Struts. The level of re-use in the web presentation layer was not acceptable to me. I am currently considering creating any new web UI features using Struts, and refactoring some of the old code as well. -Original Message- From: Frank Rizzo [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2003 9:20 PM To: Struts Users Mailing List Subject: Re: Planning Struts Application Development [snip] If it is a non trivial web application, and it will be written in java, then you should use Struts. If you don't, the developers will just end up writing (and debugging) what is already done for them in Struts. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Planning Struts Application Development
You might want to take a look at Jcorporates OpenSource Expresso framework. http://www.jcorporate.com/ Ive not used it myself yet so cant give you an experienced opinion, but it uses struts and provides whole bunch of other goodies which migh help you get a head start on your project. -Original Message- From: Lauri Jutila [mailto:[EMAIL PROTECTED] Sent: Wednesday, 29 October 2003 07:04 To: [EMAIL PROTECTED] Subject: Planning Struts Application Development Hello folks, I'm engaging in a web development project and my team is looking at Struts as a primary framework candidate for the application. Before we make final decision, I'd be glad to hear some commentary and experiences from real-world Struts users. Our project goal is to create an application which is leaning a little towards web-based group-ware applications in terms of feature set. No, we are not creating e-mail/calendar/task-list/foobar portal, but our app will include some of the basic group-ware app features and share quite many characteristics (different types of calendars come to mind). We would like our application to support at least hundreds of concurrent users. What kind of issues does this arise in terms of hardware and software/application configurations? How many users per app server would be feasible and how to handle multi-server environment gracefully? How is caching supported or implemented in Struts? What do you think are the fundamental issues to focus on design development? And if you think, based on my very poor description of requirements, that Struts may not be the right framework, what are the alternatives? Best regards, -- Lauri Jutila [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]
Seesion not available in Setspeed porlet for Struts application
Hi, We are having problem in porting an existing Struts application to a Jetspeed JSP portlet. The very first page, session information is available but not in any subsequent pages. Any other portlet I should try? Any suggestion? I am thinking about creating a bean with session scope (our application is JSP and Beans no EJB) to store information in this bean. This bean can be available to all other part of the application. Is this feasible? Any sample code available? Thank you very much! Alex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to configure a struts application
I would like to suggest on point here ... If it still don't work the way ansuman behera described then just try 1. make a folder under WEB-INF named tlds 2. move all struts*.tld files DTD in this folder regards Rohit -Original Message- From: ansuman_behera [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 2:53 PM To: Struts Users Mailing List Subject: RE: How to configure a struts application It is very easy with Tomcat too. I'm using Tomcat 4.1 and Struts 1.0.2. Here is what you need to do at a high level 1. Ensure that your web application has a folder under TOMCAT_HOME/webapps. 2. Inside this folder create a folder called WEB-INF 3. In the WEB-INF folder you should have all struts*.tld files and the DTD file and the struts configuration file. 4. Create a folder called lib under WEB-INF and keep the struts.jar file inside this lib folder. off the top of my head, I can't think of anything else that you might have to do...take some simple example code already built by someone and use it and see if this works... thanks ansuman -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 11:30 AM To: Struts Users Mailing List Subject: Re: How to configure a struts application Tomcat, I am suffering and no luck yet. I hate it now. It's very easy to do it in Weblogic. - Do not put struts.jar in Weblogic classpath or any other classpath it reads. - Struts.jar should be in your Web Application's WEB-INF/lib - Make sure you include struts.jar in your web application .war file while building it. Other then this, a Struts web application just deploys fine like any other web application on weblogic. thanks -raj Nimmagadda, Ravikumar (CORP, GEITC, To: Struts Users Mailing List [EMAIL PROTECTED] Contractor)cc: [EMAIL PROTECTED]Subject: How to configure a struts application ind.ge.com 07/08/2003 11:20 AM Please respond to Struts Users Mailing List Hi *, I am new to Struts. can any one let me know how to configure a struts application on either Tomcat4.1 or weblogic.6.x Thanks in advance. Ravi - 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] *-- This message and any attachment(s) is intended only for the use of the addressee(s) and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not the intended addressee(s), you are hereby notified that any use, distribution, disclosure or copying of this communication is strictly prohibited. If you have received this communication in error, please erase all copies of the message and its attachment(s) and notify the sender or Kanbay postmaster immediately. Any views expressed in this message are those of the individual sender and not of Kanbay. Although we have taken steps to ensure that this e-mail and any attachment(s) are free from any virus, we advise that in keeping with good computing practice the recipient should ensure
RE: How to configure a struts application
It is very easy with Tomcat too. I'm using Tomcat 4.1 and Struts 1.0.2. Here is what you need to do at a high level 1. Ensure that your web application has a folder under TOMCAT_HOME/webapps. 2. Inside this folder create a folder called WEB-INF 3. In the WEB-INF folder you should have all struts*.tld files and the DTD file and the struts configuration file. 4. Create a folder called lib under WEB-INF and keep the struts.jar file inside this lib folder. off the top of my head, I can't think of anything else that you might have to do...take some simple example code already built by someone and use it and see if this works... thanks ansuman -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 11:30 AM To: Struts Users Mailing List Subject: Re: How to configure a struts application Tomcat, I am suffering and no luck yet. I hate it now. It's very easy to do it in Weblogic. - Do not put struts.jar in Weblogic classpath or any other classpath it reads. - Struts.jar should be in your Web Application's WEB-INF/lib - Make sure you include struts.jar in your web application .war file while building it. Other then this, a Struts web application just deploys fine like any other web application on weblogic. thanks -raj Nimmagadda, Ravikumar (CORP, GEITC, To: Struts Users Mailing List [EMAIL PROTECTED] Contractor)cc: [EMAIL PROTECTED]Subject: How to configure a struts application ind.ge.com 07/08/2003 11:20 AM Please respond to Struts Users Mailing List Hi *, I am new to Struts. can any one let me know how to configure a struts application on either Tomcat4.1 or weblogic.6.x Thanks in advance. Ravi - 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]
How to configure a struts application
Hi *, I am new to Struts. can any one let me know how to configure a struts application on either Tomcat4.1 or weblogic.6.x Thanks in advance. Ravi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to configure a struts application
Tomcat, I am suffering and no luck yet. I hate it now. Its easy with tomcat also. What ever you did for weblogic , its same as that. What problem you faced ? Cheers Ashwani Kalra http://www.geocities.com/ashwani_kalra Nimmagadda, Ravikumar (CORP, GEITC, To: Struts Users Mailing List [EMAIL PROTECTED] Contractor)cc: [EMAIL PROTECTED] Subject: How to configure a struts application ind.ge.com 07/08/2003 11:20 AM Please respond to Struts Users Mailing List Hi *, I am new to Struts. can any one let me know how to configure a struts application on either Tomcat4.1 or weblogic.6.x Thanks in advance. Ravi - 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] This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to configure a struts application
First of all i get a SAX Parser exception while starting Tomcat. Then, when i try to run a simple jsp page with struts, it says resource test.do not found. thanks -raj Kalra, Ashwani [EMAIL PROTECTED]To: 'Struts Users Mailing List' [EMAIL PROTECTED] ey.com cc: Subject: RE: How to configure a struts application 07/08/2003 11:42 AM Please respond to Struts Users Mailing List Tomcat, I am suffering and no luck yet. I hate it now. Its easy with tomcat also. What ever you did for weblogic , its same as that. What problem you faced ? Cheers Ashwani Kalra http://www.geocities.com/ashwani_kalra Nimmagadda, Ravikumar (CORP, GEITC, To: Struts Users Mailing List [EMAIL PROTECTED] Contractor)cc: [EMAIL PROTECTED] Subject: How to configure a struts application ind.ge.com 07/08/2003 11:20 AM Please respond to Struts Users Mailing List Hi *, I am new to Struts. can any one let me know how to configure a struts application on either Tomcat4.1 or weblogic.6.x Thanks in advance. Ravi - 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] This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - 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: How to configure a struts application
Tomcat, I am suffering and no luck yet. I hate it now. It's very easy to do it in Weblogic. - Do not put struts.jar in Weblogic classpath or any other classpath it reads. - Struts.jar should be in your Web Application's WEB-INF/lib - Make sure you include struts.jar in your web application .war file while building it. Other then this, a Struts web application just deploys fine like any other web application on weblogic. thanks -raj Nimmagadda, Ravikumar (CORP, GEITC, To: Struts Users Mailing List [EMAIL PROTECTED] Contractor)cc: [EMAIL PROTECTED]Subject: How to configure a struts application ind.ge.com 07/08/2003 11:20 AM Please respond to Struts Users Mailing List Hi *, I am new to Struts. can any one let me know how to configure a struts application on either Tomcat4.1 or weblogic.6.x Thanks in advance. Ravi - 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: How to configure a struts application
Hi, The following URL clearly explains how to install struts http://javaboutique.internet.com/tutorials/Struts/directories.html Seshadhri Srinivasan -Original Message- From: Nimmagadda, Ravikumar (CORP, GEITC, Contractor) [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 11:21 AM To: Struts Users Mailing List Subject: How to configure a struts application Hi *, I am new to Struts. can any one let me know how to configure a struts application on either Tomcat4.1 or weblogic.6.x Thanks in advance. Ravi - 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]
Opening/reading a file from a Struts application...
Greetings all... I'm trying to load and read a text file (on the server's filesystem) from within a Struts application. I'd like to be able to put the file in the WEB-INF, or the WEB-INF/classes directory, but am having trouble finding the file (i.e. I'm having trouble obtaining the path that I need in order to open the file), and reading it... Here's what my research has turned up: // Something like this will return an InputStream. This is fine for properties files // since you can load a properties file by passing an InputStream to the load method // on a Properties object Thread.currentThread().getContextClassLoader().getResourceAsStream(my.p roperties); The problem with this is that the methods that I'm using to read the contents of files takes either a string that represents the file name, or a File object... The methods then calculate the file's length, read the file into an array of bytes, and return the contents of the array in various forms (i.e. An array of bytes, a string, etc.). Does anyone have any suggestions about how best to go about doing this (I could change the methods that read the contents of files into strings, but I'm not sure exactly how to go about doing this). Any help would be greatly appreciated... Cheers... Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Opening/reading a file from a Struts application...
-Original Message- From: Jarnot Voytek Contr AU HQ/SC Sent: Friday, June 27, 2003 11:53 AM To: 'Struts Users Mailing List' Subject: RE: getting a file path to /WEB-INF from a HttpSession try request.getSession(false).getServletContext().getRealPath(/WEB-INF/...)) or, in an action you could do getServlet().getServletContext().getRealPath(/WEB-INF/...); -- Voytek Jarnot Quidquid latine dictum sit, altum viditur. -Original Message- From: Davide Bruzzone [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 12:58 PM To: Struts Users Mailing List Subject: Opening/reading a file from a Struts application... Greetings all... I'm trying to load and read a text file (on the server's filesystem) from within a Struts application. I'd like to be able to put the file in the WEB-INF, or the WEB-INF/classes directory, but am having trouble finding the file (i.e. I'm having trouble obtaining the path that I need in order to open the file), and reading it... Here's what my research has turned up: // Something like this will return an InputStream. This is fine for properties files // since you can load a properties file by passing an InputStream to the load method // on a Properties object Thread.currentThread().getContextClassLoader().getResourceAsSt ream(my.p roperties); The problem with this is that the methods that I'm using to read the contents of files takes either a string that represents the file name, or a File object... The methods then calculate the file's length, read the file into an array of bytes, and return the contents of the array in various forms (i.e. An array of bytes, a string, etc.). Does anyone have any suggestions about how best to go about doing this (I could change the methods that read the contents of files into strings, but I'm not sure exactly how to go about doing this). Any help would be greatly appreciated... Cheers... 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: Opening/reading a file from a Struts application...
Thank you... I'll give it a try... Cheers... Dave -Original Message- From: Jarnot Voytek Contr AU HQ/SC [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 12:02 PM To: 'Struts Users Mailing List' Subject: RE: Opening/reading a file from a Struts application... -Original Message- From: Jarnot Voytek Contr AU HQ/SC Sent: Friday, June 27, 2003 11:53 AM To: 'Struts Users Mailing List' Subject: RE: getting a file path to /WEB-INF from a HttpSession try request.getSession(false).getServletContext().getRealPath(/WEB-INF/... )) or, in an action you could do getServlet().getServletContext().getRealPath(/WEB-INF/...); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Opening/reading a file from a Struts application...
On Tue, 29 Jul 2003, Davide Bruzzone wrote: Date: Tue, 29 Jul 2003 11:57:41 -0600 From: Davide Bruzzone [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Opening/reading a file from a Struts application... Greetings all... I'm trying to load and read a text file (on the server's filesystem) from within a Struts application. I'd like to be able to put the file in the WEB-INF, or the WEB-INF/classes directory, but am having trouble finding the file (i.e. I'm having trouble obtaining the path that I need in order to open the file), and reading it... Here's what my research has turned up: // Something like this will return an InputStream. This is fine for properties files // since you can load a properties file by passing an InputStream to the load method // on a Properties object Thread.currentThread().getContextClassLoader().getResourceAsStream(my.p roperties); This only works on files visible to the class loader (i.e. files in /WEB-INF/classes, or packaged in JARs inside /WEB-INF/lib). To read general resources in your webapp, try ServletContext.getResourceAsStream() instead. You pass it a context-relative path like /WEB-INF/my.properties. The problem with this is that the methods that I'm using to read the contents of files takes either a string that represents the file name, or a File object... The methods then calculate the file's length, read the file into an array of bytes, and return the contents of the array in various forms (i.e. An array of bytes, a string, etc.). That's not going to be portable, because you cannot assume that webapp resources actually live in the filesystem - you might be running straight from a WAR file, or in a container that puts all the static resources in BLOBs in a database, or ... If you really need file i/o access to this stuff, you should create an initialization parameter pointing at the directory containing the relevant files, and then access then outside your webapp hierarchy. Does anyone have any suggestions about how best to go about doing this (I could change the methods that read the contents of files into strings, but I'm not sure exactly how to go about doing this). Any help would be greatly appreciated... Cheers... Dave Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Opening/reading a file from a Struts application...
At 12:23 -0600 7/29/03, Davide Bruzzone spoke thusly: Note that getRealPath(/WEB-INF/...) is allowed to fail (under the spec). I know for a fact that in several containers, if your deploy as a WAR file, it will indeed fail. Here are two alternatives that will always work to access files in /WEB-INF: 1) String path = /WEB-INF/myfile.ext; InputStream istream = servletContext.getResourceAsStream(path); 2) String path = /WEB-INF/myfile.ext; URL url = servletContext.getResource(path); URLConnection uconn = url.openConnection(); InputStream istream = uconn.getInputStream(); What remains to solve your problem is to refactor your code to accept an InputStream rather than a File. It appears that File is used to length() can be called on it so the byte array can be properly allocated. If the resource is truly a file, it appears the istream.available() will do that job for you (although I have not tested this). Thank you... I'll give it a try... Cheers... Dave -Original Message- From: Jarnot Voytek Contr AU HQ/SC [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 12:02 PM To: 'Struts Users Mailing List' Subject: RE: Opening/reading a file from a Struts application... -Original Message- From: Jarnot Voytek Contr AU HQ/SC Sent: Friday, June 27, 2003 11:53 AM To: 'Struts Users Mailing List' Subject: RE: getting a file path to /WEB-INF from a HttpSession try request.getSession(false).getServletContext().getRealPath(/WEB-INF/... )) or, in an action you could do getServlet().getServletContext().getRealPath(/WEB-INF/...); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Dolf Starreveld 190 Thompson Square http://www.starreveld.com Mountain View, CA 94043 Home: (650) 966-1404Mobile: (415) 613-7229 FAX: (650) 967-2863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Opening/reading a file from a Struts application...
Check this class Resource.java created by Jason Hunter of servlets.com fame to locate a file on the classpath first and then class loader getResource(). Vijay -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 11:36 AM To: Struts Users Mailing List Subject: Re: Opening/reading a file from a Struts application... On Tue, 29 Jul 2003, Davide Bruzzone wrote: Date: Tue, 29 Jul 2003 11:57:41 -0600 From: Davide Bruzzone [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Opening/reading a file from a Struts application... Greetings all... I'm trying to load and read a text file (on the server's filesystem) from within a Struts application. I'd like to be able to put the file in the WEB-INF, or the WEB-INF/classes directory, but am having trouble finding the file (i.e. I'm having trouble obtaining the path that I need in order to open the file), and reading it... Here's what my research has turned up: // Something like this will return an InputStream. This is fine for properties files // since you can load a properties file by passing an InputStream to the load method // on a Properties object Thread.currentThread().getContextClassLoader().getResourceAsStream(my.p roperties); This only works on files visible to the class loader (i.e. files in /WEB-INF/classes, or packaged in JARs inside /WEB-INF/lib). To read general resources in your webapp, try ServletContext.getResourceAsStream() instead. You pass it a context-relative path like /WEB-INF/my.properties. The problem with this is that the methods that I'm using to read the contents of files takes either a string that represents the file name, or a File object... The methods then calculate the file's length, read the file into an array of bytes, and return the contents of the array in various forms (i.e. An array of bytes, a string, etc.). That's not going to be portable, because you cannot assume that webapp resources actually live in the filesystem - you might be running straight from a WAR file, or in a container that puts all the static resources in BLOBs in a database, or ... If you really need file i/o access to this stuff, you should create an initialization parameter pointing at the directory containing the relevant files, and then access then outside your webapp hierarchy. Does anyone have any suggestions about how best to go about doing this (I could change the methods that read the contents of files into strings, but I'm not sure exactly how to go about doing this). Any help would be greatly appreciated... Cheers... Dave Craig - 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: Opening/reading a file from a Struts application...
You can load Properties files like this: java.io.InputStream in = baseClass.getResourceAsStream(fileName); Properties props = new Properties(); props.load(in); I use this with my base classes, as the have to work outside my Tomcat, too, that's what base classes for, after all. Have not tried but should work with other files as well. Stephan Davide Bruzzone wrote: Greetings all... I'm trying to load and read a text file (on the server's filesystem) from within a Struts application. I'd like to be able to put the file in the WEB-INF, or the WEB-INF/classes directory, but am having trouble finding the file (i.e. I'm having trouble obtaining the path that I need in order to open the file), and reading it... Here's what my research has turned up: // Something like this will return an InputStream. This is fine for properties files // since you can load a properties file by passing an InputStream to the load method // on a Properties object Thread.currentThread().getContextClassLoader().getResourceAsStream(my.p roperties); The problem with this is that the methods that I'm using to read the contents of files takes either a string that represents the file name, or a File object... The methods then calculate the file's length, read the file into an array of bytes, and return the contents of the array in various forms (i.e. An array of bytes, a string, etc.). Does anyone have any suggestions about how best to go about doing this (I could change the methods that read the contents of files into strings, but I'm not sure exactly how to go about doing this). Any help would be greatly appreciated... Cheers... 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]
opinion on a revised Struts application flow
A colleague of mine has suggestion a new flow to a wizard-like application and I thought I would ask the list for their opinion on the matter. Traditionally, the Struts convention has been to submit a form to an action that would handle that forms data and setup the next JSP. I have implemented this flow and extended DispatchAction to include a couple of methods for each action which are the following: 1. init() - handles the previous form's data and sets up the initial state of the next form 2. update() - based on a selection on the form and necessity for a server trip, this method will do something and return to the form. The proposed suggestion is to let the initial action handle the form submit instead of the next action so everything related to a specific JSP form is contained in one action. The suggestion would add another method in the DispatchAction as follows: 1. init() 2. update() 3. submitForm() - this would validate and handle the JSP form data as opposed to the next action handling the data. Something else that should be mentioned is that we are also implementing the Unit of Work pattern to handle data in each action. This implementation would eliminate a dependency of data handled by the previous actions. Any thoughts or suggestions would be appreciated. Thanks, Shane Witbeck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
log4j in struts application
Hi all, I'm trying to use the Log4J package in my webapplication. Therefore I placed the file log4j.properties in WEB-INF/classes which looks like this: log4j.rootLogger = DEBUG, stdout, rolling log4j.appender.stdout = ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.appender.rolling=org.apache.log4j.RollingFileAppender log4j.appender.rolling.File=/var/ordermanager/log/ordermanager.log log4j.appender.rolling.MaxFileSize=100KB log4j.appender.rolling.MaxBackupIndex=1 log4j.appender.rolling.layout=org.apache.log4j.PatternLayout log4j.appender.rolling.layout.ConversionPattern=%d{ABSOLUTE} - %p %c - %m%n I also have a file commons-logging.properties which contains: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog (B.t.w. I also tried to remove this file (commons-logging.properties) which has no effect). In my Actions I have code like this: Log log = LogFactory.getLog(BasicAction.class); if (log.isInfoEnabled()) { log.info(Log test!); } I'm using JBoss with integrated Tomcat 4.1 (on linux). In the JBoss log I see: 09:51:52,853 INFO [OrdermanagerBaseAction] OrderManagerBaseAction called! But, nothing appears in /var/ordermanager/log/ordermanager.log Permissions, etc are all okay What could be wrong here? Many thanks, Harm de Laat Informatiefabriek The Netherlands - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: log4j in struts application
[EMAIL PROTECTED] rta: I'm using JBoss with integrated Tomcat 4.1 (on linux). In the JBoss log I see: Jboss has its own log4j config file. It is used container-wise, so you should configure that. It is checked every minute, and reloaded the logging if changed. I cannot remember the name, maybe log4j-config.xml in the conf dir. Tib - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Mutil URL access to a struts application
Hi all, I just finished my struts 1.0 application, and now I would like to access to my application through several URL : My root context is APP and I want to access to my application with, for example : http://localhost:9080/APP/init.do http://localhost:9080/APP/foo/init.do http://localhost:9080/APP/foo2/init.do and depend on the url context I want to have a different behaviour in my application But I don't want to change anything in my struts-config.xml file (perhaps in the jsp). I have something like that : servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping in my web.xml, I try to add url-pattern/foo/*.do/url-pattern with no success. Thanks, Laurent
Re: Mutil URL access to a struts application
One approach is to create separate action mappings for /init /foo/init /foo/init2 all of which forward to the same action class, and then decode the mapping in the action to determine what to do. E.g., String path = mapping.getPath(); if (path.equals(/init.do) { } else { Joe Baker Director of Internet Communications Amnesty International USA http://amnestyusa.org [EMAIL PROTECTED] Laurent Garcia [EMAIL PROTECTED] 06/04/03 11:03 AM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:Mutil URL access to a struts application Hi all, I just finished my struts 1.0 application, and now I would like to access to my application through several URL : My root context is APP and I want to access to my application with, for example : http://localhost:9080/APP/init.do http://localhost:9080/APP/foo/init.do http://localhost:9080/APP/foo2/init.do and depend on the url context I want to have a different behaviour in my application But I don't want to change anything in my struts-config.xml file (perhaps in the jsp). I have something like that : servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping in my web.xml, I try to add url-pattern/foo/*.do/url-pattern with no success. Thanks, Laurent
RE: Mutil URL access to a struts application
I looked at that the other day because I wanted to do something like: servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping servlet-mapping servlet-nameaction/servlet-name url-pattern*.jsp/url-pattern /servlet-mapping and in my controller (which would be a subclass of ActionServlet) I would disallow *.jsp and throw to a page and then process *.do normally. I noticed that all my actions where then generated (in my JSP) as html:form action=/login.jsp instead of action=login.do so I looked at the struts source and saw that only one pattern could be specified and so it fills that pattern with the last one entered in the web.xml. Unless I was just tired and was seeing things. :-) That is how I determined it works. -Original Message- From: Laurent Garcia [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 11:04 AM To: [EMAIL PROTECTED] Subject: Mutil URL access to a struts application Hi all, I just finished my struts 1.0 application, and now I would like to access to my application through several URL : My root context is APP and I want to access to my application with, for example : http://localhost:9080/APP/init.do http://localhost:9080/APP/foo/init.do http://localhost:9080/APP/foo2/init.do and depend on the url context I want to have a different behaviour in my application But I don't want to change anything in my struts-config.xml file (perhaps in the jsp). I have something like that : servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping in my web.xml, I try to add url-pattern/foo/*.do/url-pattern with no success. Thanks, Laurent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mutil URL access to a struts application
Deploy three different instances of your app, one instance at each of these context paths: /APP /APP/foo /APP/foo2 -Max - Original Message - From: Laurent Garcia [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 8:03 AM Subject: Mutil URL access to a struts application Hi all, I just finished my struts 1.0 application, and now I would like to access to my application through several URL : My root context is APP and I want to access to my application with, for example : http://localhost:9080/APP/init.do http://localhost:9080/APP/foo/init.do http://localhost:9080/APP/foo2/init.do and depend on the url context I want to have a different behaviour in my application But I don't want to change anything in my struts-config.xml file (perhaps in the jsp). I have something like that : servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping in my web.xml, I try to add url-pattern/foo/*.do/url-pattern with no success. Thanks, Laurent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] intermittent build and deploy Struts application to WLS problem
This is a bit OT (probably has nothing to do with struts), but the problem has gone from an irritation to annoying to really starting to tick me off. I hope that since many of you are working with similar environments that you may be able to help me out here: Problem --- Intermittently when I deploy to WLS I will receive anywhere from 1 to about 40 errors of the form: 'Public class blah blah blah must be defined in a file called blah blah blah' (I think these errors are thrown when the WLS is attempting to recompile my EJB JAR within the server, not sure about that though). The clinker is that if I change no source code, recompile and redeploy again, then occasionally I will not have the errors and everything will run fine from there on in. There have been times where I have gone through the hair pulling process of running my ant clean, ant build scripts, and attempting to deploy 10 times before all of the sudden Blamo, it works only to fail again the next time I need to recompile. Environment description --- 1. I edit source, compile and build WAR, EJB JAR, support class JAR, and EAR on Windows 2K using ant. I use the manifest.update feature to put class path info about classes used in both EJBs and Servlets into the EAR file. 2. ANT_HOME = \apache-ant-1.5.3Beta1 (also tried 1.5.2 and 1.5.1) 3. JAVA_HOME = \j2sdk_forte\jdk1.4.0 (also tried 1.3.1) 4. Attempting to deploy EAR to BEA Web Logic Server 6.1 sp4 (also tried sp2) running on a Sun server using WLS browser based admin tool. 5. The application uses Struts, log4j, rowtag among other things. Some Observations - 1. The size of my EAR file changes each time I run my ant build script. Looking inside the EAR I see that the compressed sizes of my WAR and EJB JAR, and support class JAR files change each time the EAR build is run (while the sizes of the original WAR and JARs remain the same - and the original and compressed sizes of all my 3rd party JARs also remain the same). 2. Also I notice that when the size of the EAR gets smaller then the app is more likely to deploy ok. 3. If I attempt to redeploy the same EAR file over and over then I will get the same number of errors each time. If I recompile and deploy I will get a different number of errors (or none). If I have an EAR file that works then I can redeploy that EAR file over and over and never get an error. 4. Have never seen the error when I deploy to JBOSS on my local Win 2K machine. Some Things I've tried -- 1. change time out settings on http within WLS 2. deleting the old .ear file from WLS before redeploy 3. deleting the .wlnotdelete file from WLS before deploy 4. restarting the wls 5. undeploying, refreshing wls view, compiling, redeploying all in different orders 6. holding my breath and crossing my fingers 7. not watching the deployment dos screen 8. watching the deployment dos screen 9. manually ftping the file to wls 10. wls running in debug mode 11. wls running in production mode 12. wls update from 6.1 to 6.1.4 something 13. removing all dos crlf from java and jsp in ant 14. touching all java and jsp files in ant 15. browsing ear and jar files for clues 16. asking wls admin for help 17. tracking size of ear files 18. noticing that ear file size changes even when no source has changed 19. suspecting something screwey with build process 20. stop wls during build 21. starting wls duing build 22. changed structure of EAR file 23. removed common classes from WAR and JAR and put in EAR with Manifest 24. put shared classes in a common JAR 25. updated from ant version 5.0 to 5.2 I've been living with this for months now, but my patience with it is wearing out the closer I get to the due date. Any help very much appreciated. - Jim Piper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] intermittent build and deploy Struts application to WLS problem
Dump WLS and go over to JBOSS in production. We are currenly going to save something like 500k by not upgrading to wls 7.0 or wls 8.0 and go directly to Jboss in production. - Original Message - From: Piper, James D CECOM SEC EPS [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 04, 2003 11:51 AM Subject: [OT] intermittent build and deploy Struts application to WLS pro blem This is a bit OT (probably has nothing to do with struts), but the problem has gone from an irritation to annoying to really starting to tick me off. I hope that since many of you are working with similar environments that you may be able to help me out here: Problem --- Intermittently when I deploy to WLS I will receive anywhere from 1 to about 40 errors of the form: 'Public class blah blah blah must be defined in a file called blah blah blah' (I think these errors are thrown when the WLS is attempting to recompile my EJB JAR within the server, not sure about that though). The clinker is that if I change no source code, recompile and redeploy again, then occasionally I will not have the errors and everything will run fine from there on in. There have been times where I have gone through the hair pulling process of running my ant clean, ant build scripts, and attempting to deploy 10 times before all of the sudden Blamo, it works only to fail again the next time I need to recompile. Environment description --- 1. I edit source, compile and build WAR, EJB JAR, support class JAR, and EAR on Windows 2K using ant. I use the manifest.update feature to put class path info about classes used in both EJBs and Servlets into the EAR file. 2. ANT_HOME = \apache-ant-1.5.3Beta1 (also tried 1.5.2 and 1.5.1) 3. JAVA_HOME = \j2sdk_forte\jdk1.4.0 (also tried 1.3.1) 4. Attempting to deploy EAR to BEA Web Logic Server 6.1 sp4 (also tried sp2) running on a Sun server using WLS browser based admin tool. 5. The application uses Struts, log4j, rowtag among other things. Some Observations - 1. The size of my EAR file changes each time I run my ant build script. Looking inside the EAR I see that the compressed sizes of my WAR and EJB JAR, and support class JAR files change each time the EAR build is run (while the sizes of the original WAR and JARs remain the same - and the original and compressed sizes of all my 3rd party JARs also remain the same). 2. Also I notice that when the size of the EAR gets smaller then the app is more likely to deploy ok. 3. If I attempt to redeploy the same EAR file over and over then I will get the same number of errors each time. If I recompile and deploy I will get a different number of errors (or none). If I have an EAR file that works then I can redeploy that EAR file over and over and never get an error. 4. Have never seen the error when I deploy to JBOSS on my local Win 2K machine. Some Things I've tried -- 1. change time out settings on http within WLS 2. deleting the old .ear file from WLS before redeploy 3. deleting the .wlnotdelete file from WLS before deploy 4. restarting the wls 5. undeploying, refreshing wls view, compiling, redeploying all in different orders 6. holding my breath and crossing my fingers 7. not watching the deployment dos screen 8. watching the deployment dos screen 9. manually ftping the file to wls 10. wls running in debug mode 11. wls running in production mode 12. wls update from 6.1 to 6.1.4 something 13. removing all dos crlf from java and jsp in ant 14. touching all java and jsp files in ant 15. browsing ear and jar files for clues 16. asking wls admin for help 17. tracking size of ear files 18. noticing that ear file size changes even when no source has changed 19. suspecting something screwey with build process 20. stop wls during build 21. starting wls duing build 22. changed structure of EAR file 23. removed common classes from WAR and JAR and put in EAR with Manifest 24. put shared classes in a common JAR 25. updated from ant version 5.0 to 5.2 I've been living with this for months now, but my patience with it is wearing out the closer I get to the due date. Any help very much appreciated. - Jim Piper - 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] intermittent build and deploy Struts application to WLS pro blem
we're currently struggling with this as well, I'm all for dumping iplanet and move to jboss, but other people in the organization do not feel comfortable with switching over to a non-sun-certified-freeware-app server.. so far, so what, it's better! is not working, any suggestions from the group?? -Original Message- From: Daniel Jaffa [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 9:10 AM To: Struts Users Mailing List Subject: Re: [OT] intermittent build and deploy Struts application to WLS pro blem Dump WLS and go over to JBOSS in production. We are currenly going to save something like 500k by not upgrading to wls 7.0 or wls 8.0 and go directly to Jboss in production. - Original Message - From: Piper, James D CECOM SEC EPS [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 04, 2003 11:51 AM Subject: [OT] intermittent build and deploy Struts application to WLS pro blem This is a bit OT (probably has nothing to do with struts), but the problem has gone from an irritation to annoying to really starting to tick me off. I hope that since many of you are working with similar environments that you may be able to help me out here: Problem --- Intermittently when I deploy to WLS I will receive anywhere from 1 to about 40 errors of the form: 'Public class blah blah blah must be defined in a file called blah blah blah' (I think these errors are thrown when the WLS is attempting to recompile my EJB JAR within the server, not sure about that though). The clinker is that if I change no source code, recompile and redeploy again, then occasionally I will not have the errors and everything will run fine from there on in. There have been times where I have gone through the hair pulling process of running my ant clean, ant build scripts, and attempting to deploy 10 times before all of the sudden Blamo, it works only to fail again the next time I need to recompile. Environment description --- 1. I edit source, compile and build WAR, EJB JAR, support class JAR, and EAR on Windows 2K using ant. I use the manifest.update feature to put class path info about classes used in both EJBs and Servlets into the EAR file. 2. ANT_HOME = \apache-ant-1.5.3Beta1 (also tried 1.5.2 and 1.5.1) 3. JAVA_HOME = \j2sdk_forte\jdk1.4.0 (also tried 1.3.1) 4. Attempting to deploy EAR to BEA Web Logic Server 6.1 sp4 (also tried sp2) running on a Sun server using WLS browser based admin tool. 5. The application uses Struts, log4j, rowtag among other things. Some Observations - 1. The size of my EAR file changes each time I run my ant build script. Looking inside the EAR I see that the compressed sizes of my WAR and EJB JAR, and support class JAR files change each time the EAR build is run (while the sizes of the original WAR and JARs remain the same - and the original and compressed sizes of all my 3rd party JARs also remain the same). 2. Also I notice that when the size of the EAR gets smaller then the app is more likely to deploy ok. 3. If I attempt to redeploy the same EAR file over and over then I will get the same number of errors each time. If I recompile and deploy I will get a different number of errors (or none). If I have an EAR file that works then I can redeploy that EAR file over and over and never get an error. 4. Have never seen the error when I deploy to JBOSS on my local Win 2K machine. Some Things I've tried -- 1. change time out settings on http within WLS 2. deleting the old .ear file from WLS before redeploy 3. deleting the .wlnotdelete file from WLS before deploy 4. restarting the wls 5. undeploying, refreshing wls view, compiling, redeploying all in different orders 6. holding my breath and crossing my fingers 7. not watching the deployment dos screen 8. watching the deployment dos screen 9. manually ftping the file to wls 10. wls running in debug mode 11. wls running in production mode 12. wls update from 6.1 to 6.1.4 something 13. removing all dos crlf from java and jsp in ant 14. touching all java and jsp files in ant 15. browsing ear and jar files for clues 16. asking wls admin for help 17. tracking size of ear files 18. noticing that ear file size changes even when no source has changed 19. suspecting something screwey with build process 20. stop wls during build 21. starting wls duing build 22. changed structure of EAR file 23. removed common classes from WAR and JAR and put in EAR with Manifest 24. put shared classes in a common JAR 25. updated from ant version 5.0 to 5.2 I've been living with this for months now, but my patience with it is wearing out the closer I get to the due date. Any help very much appreciated. - Jim Piper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: [OT] intermittent build and deploy Struts application to WLS problem
Another alternative would be to use WebLogic Express, which is WebLogic without the EJB container. It should be much cheaper than WebLogic platform, and will satisfy the suits. -Original Message- From: Miriam Aguirre [mailto:[EMAIL PROTECTED] we're currently struggling with this as well, I'm all for dumping iplanet and move to jboss, but other people in the organization do not feel comfortable with switching over to a non-sun-certified-freeware-app server.. so far, so what, it's better! is not working, any suggestions from the group?? -Original Message- From: Daniel Jaffa [mailto:[EMAIL PROTECTED] Dump WLS and go over to JBOSS in production. We are currenly going to save something like 500k by not upgrading to wls 7.0 or wls 8.0 and go directly to Jboss in production. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] intermittent build and deploy Struts application to WLS problem
I wasn't going to step into this but I've used WLS for years - since Tengah days - and feel its a great product. I am seeing a growing interest in JBoss but I think for large enterprise applications WLS platform offers much more. I think this is even more true of WLS 8.1 platform which we're just getting into now. I buy into the single programming model provided by Workshop for EAI, Portal and J2EE applications. In this model EAI and Portal are just another J2EE application style. When you need portal and EAI features + solid scaling and reliability I would still be hard to convince that JBoss provides the kinds of features WLS does. If you buy into the Application Suites or platform story than JBoss isn't really in the game yet. Also, I think its to BEA's credit that the Workshop 8.1 is using STRUTS 1.1 underneath as its implementation. This is a big endorsement for STRUTS. Wayne Lund Accenture Global Architecture and Core Technologies, Seattle [EMAIL PROTECTED] (p:) 206.839.2169 (c:) 206 849-6867 (o:) 239/2168 Miriam Aguirre [EMAIL PROTECTED] 04/04/2003 10:21 AM Please respond to Struts Users Mailing List To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc: Subject:RE: [OT] intermittent build and deploy Struts application to WLS pro blem we're currently struggling with this as well, I'm all for dumping iplanet and move to jboss, but other people in the organization do not feel comfortable with switching over to a non-sun-certified-freeware-app server.. so far, so what, it's better! is not working, any suggestions from the group?? -Original Message- From: Daniel Jaffa [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 9:10 AM To: Struts Users Mailing List Subject: Re: [OT] intermittent build and deploy Struts application to WLS pro blem Dump WLS and go over to JBOSS in production. We are currenly going to save something like 500k by not upgrading to wls 7.0 or wls 8.0 and go directly to Jboss in production. - Original Message - From: Piper, James D CECOM SEC EPS [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 04, 2003 11:51 AM Subject: [OT] intermittent build and deploy Struts application to WLS pro blem This is a bit OT (probably has nothing to do with struts), but the problem has gone from an irritation to annoying to really starting to tick me off. I hope that since many of you are working with similar environments that you may be able to help me out here: Problem --- Intermittently when I deploy to WLS I will receive anywhere from 1 to about 40 errors of the form: 'Public class blah blah blah must be defined in a file called blah blah blah' (I think these errors are thrown when the WLS is attempting to recompile my EJB JAR within the server, not sure about that though). The clinker is that if I change no source code, recompile and redeploy again, then occasionally I will not have the errors and everything will run fine from there on in. There have been times where I have gone through the hair pulling process of running my ant clean, ant build scripts, and attempting to deploy 10 times before all of the sudden Blamo, it works only to fail again the next time I need to recompile. Environment description --- 1. I edit source, compile and build WAR, EJB JAR, support class JAR, and EAR on Windows 2K using ant. I use the manifest.update feature to put class path info about classes used in both EJBs and Servlets into the EAR file. 2. ANT_HOME = \apache-ant-1.5.3Beta1 (also tried 1.5.2 and 1.5.1) 3. JAVA_HOME = \j2sdk_forte\jdk1.4.0 (also tried 1.3.1) 4. Attempting to deploy EAR to BEA Web Logic Server 6.1 sp4 (also tried sp2) running on a Sun server using WLS browser based admin tool. 5. The application uses Struts, log4j, rowtag among other things. Some Observations - 1. The size of my EAR file changes each time I run my ant build script. Looking inside the EAR I see that the compressed sizes of my WAR and EJB JAR, and support class JAR files change each time the EAR build is run (while the sizes of the original WAR and JARs remain the same - and the original and compressed sizes of all my 3rd party JARs also remain the same). 2. Also I notice that when the size of the EAR gets smaller then the app is more likely to deploy ok. 3. If I attempt to redeploy the same EAR file over and over then I will get the same number of errors each time. If I recompile and deploy I will get a different number of errors (or none). If I have an EAR file that works then I can redeploy that EAR file over and over and never get an error. 4. Have never seen the error when I deploy to JBOSS on my local Win 2K machine. Some Things I've tried -- 1. change time out settings on http within WLS 2. deleting the old .ear file from WLS before redeploy 3. deleting the .wlnotdelete file from WLS
RE: [OT] intermittent build and deploy Struts application to WLS problem
I wondered if your post meant that you had similar problems with build/deploy giving funny intermittent errors or if you were just fed up with pricey app servers giving you headaches? For me changing app servers is not an option, but I would be fascinated to know if you were having similar build/deploy intermittent errors - since you apparently use iPlanet and I use WLS, that would lead me to think my problem lies more with the ant/javac/jar tools or EAR structure than it does with the WLS app server. I really don't think it is the WLS app server, because when an EAR file works it will continue to work over many deployments, and when an EAR file fails it will always fail the same way over many deployment attempts. - Jim Piper -Original Message- From: Miriam Aguirre [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 1:22 PM To: 'Struts Users Mailing List' Subject: RE: [OT] intermittent build and deploy Struts application to WLS pro blem we're currently struggling with this as well, I'm all for dumping iplanet and move to jboss, but other people in the organization do not feel comfortable with switching over to a non-sun-certified-freeware-app server.. so far, so what, it's better! is not working, any suggestions from the group?? -Original Message- From: Daniel Jaffa [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 9:10 AM To: Struts Users Mailing List Subject: Re: [OT] intermittent build and deploy Struts application to WLS pro blem Dump WLS and go over to JBOSS in production. We are currenly going to save something like 500k by not upgrading to wls 7.0 or wls 8.0 and go directly to Jboss in production. - Original Message - From: Piper, James D CECOM SEC EPS [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 04, 2003 11:51 AM Subject: [OT] intermittent build and deploy Struts application to WLS pro blem This is a bit OT (probably has nothing to do with struts), but the problem has gone from an irritation to annoying to really starting to tick me off. I hope that since many of you are working with similar environments that you may be able to help me out here: Problem --- Intermittently when I deploy to WLS I will receive anywhere from 1 to about 40 errors of the form: 'Public class blah blah blah must be defined in a file called blah blah blah' (I think these errors are thrown when the WLS is attempting to recompile my EJB JAR within the server, not sure about that though). The clinker is that if I change no source code, recompile and redeploy again, then occasionally I will not have the errors and everything will run fine from there on in. There have been times where I have gone through the hair pulling process of running my ant clean, ant build scripts, and attempting to deploy 10 times before all of the sudden Blamo, it works only to fail again the next time I need to recompile. Environment description --- 1. I edit source, compile and build WAR, EJB JAR, support class JAR, and EAR on Windows 2K using ant. I use the manifest.update feature to put class path info about classes used in both EJBs and Servlets into the EAR file. 2. ANT_HOME = \apache-ant-1.5.3Beta1 (also tried 1.5.2 and 1.5.1) 3. JAVA_HOME = \j2sdk_forte\jdk1.4.0 (also tried 1.3.1) 4. Attempting to deploy EAR to BEA Web Logic Server 6.1 sp4 (also tried sp2) running on a Sun server using WLS browser based admin tool. 5. The application uses Struts, log4j, rowtag among other things. Some Observations - 1. The size of my EAR file changes each time I run my ant build script. Looking inside the EAR I see that the compressed sizes of my WAR and EJB JAR, and support class JAR files change each time the EAR build is run (while the sizes of the original WAR and JARs remain the same - and the original and compressed sizes of all my 3rd party JARs also remain the same). 2. Also I notice that when the size of the EAR gets smaller then the app is more likely to deploy ok. 3. If I attempt to redeploy the same EAR file over and over then I will get the same number of errors each time. If I recompile and deploy I will get a different number of errors (or none). If I have an EAR file that works then I can redeploy that EAR file over and over and never get an error. 4. Have never seen the error when I deploy to JBOSS on my local Win 2K machine. Some Things I've tried -- 1. change time out settings on http within WLS 2. deleting the old .ear file from WLS before redeploy 3. deleting the .wlnotdelete file from WLS before deploy 4. restarting the wls 5. undeploying, refreshing wls view, compiling, redeploying all in different orders 6. holding my breath and crossing my fingers 7. not watching the deployment dos screen 8. watching the deployment dos screen 9. manually ftping the file to wls 10. wls running in debug mode 11. wls running in production mode 12. wls update
Re: [OT] intermittent build and deploy Struts application to WLS problem
But you still need a license for each developer, and for a large project this is alot of money - Original Message - From: Karr, David [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, April 04, 2003 1:26 PM Subject: RE: [OT] intermittent build and deploy Struts application to WLS pro blem Another alternative would be to use WebLogic Express, which is WebLogic without the EJB container. It should be much cheaper than WebLogic platform, and will satisfy the suits. -Original Message- From: Miriam Aguirre [mailto:[EMAIL PROTECTED] we're currently struggling with this as well, I'm all for dumping iplanet and move to jboss, but other people in the organization do not feel comfortable with switching over to a non-sun-certified-freeware-app server.. so far, so what, it's better! is not working, any suggestions from the group?? -Original Message- From: Daniel Jaffa [mailto:[EMAIL PROTECTED] Dump WLS and go over to JBOSS in production. We are currenly going to save something like 500k by not upgrading to wls 7.0 or wls 8.0 and go directly to Jboss in production. - 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] intermittent build and deploy Struts application to WLS problem
iplanet has a whole slew of its own inadequacies.. for example, we can't even get struts 1.1 to run unless we add the jar to its classpath (which is not an option for us) - the class loader says it can't find the PropertyMessageResourcesFactory even though its under the WEB-INF/lib directory, so we're stuck with the older version of struts. Deployment is a pain with iplanet, the deployment tool is really picky and inconsistent with the command line deploy tool (which we prefer to use with ant, to make 'deploy' another target in the build file), sometimes it reports no errors, but it doesn't deploy anything! To summarize, Iplanet sucks ( app server 6.0 SP4 and 6.5, still waiting for 7.0 enterprise edition). -Original Message- From: Piper, James D CECOM SEC EPS [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 11:56 AM To: 'Struts Users Mailing List' Subject: RE: [OT] intermittent build and deploy Struts application to WLS problem I wondered if your post meant that you had similar problems with build/deploy giving funny intermittent errors or if you were just fed up with pricey app servers giving you headaches? For me changing app servers is not an option, but I would be fascinated to know if you were having similar build/deploy intermittent errors - since you apparently use iPlanet and I use WLS, that would lead me to think my problem lies more with the ant/javac/jar tools or EAR structure than it does with the WLS app server. I really don't think it is the WLS app server, because when an EAR file works it will continue to work over many deployments, and when an EAR file fails it will always fail the same way over many deployment attempts. - Jim Piper -Original Message- From: Miriam Aguirre [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 1:22 PM To: 'Struts Users Mailing List' Subject: RE: [OT] intermittent build and deploy Struts application to WLS pro blem we're currently struggling with this as well, I'm all for dumping iplanet and move to jboss, but other people in the organization do not feel comfortable with switching over to a non-sun-certified-freeware-app server.. so far, so what, it's better! is not working, any suggestions from the group?? -Original Message- From: Daniel Jaffa [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 9:10 AM To: Struts Users Mailing List Subject: Re: [OT] intermittent build and deploy Struts application to WLS pro blem Dump WLS and go over to JBOSS in production. We are currenly going to save something like 500k by not upgrading to wls 7.0 or wls 8.0 and go directly to Jboss in production. - Original Message - From: Piper, James D CECOM SEC EPS [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 04, 2003 11:51 AM Subject: [OT] intermittent build and deploy Struts application to WLS pro blem This is a bit OT (probably has nothing to do with struts), but the problem has gone from an irritation to annoying to really starting to tick me off. I hope that since many of you are working with similar environments that you may be able to help me out here: Problem --- Intermittently when I deploy to WLS I will receive anywhere from 1 to about 40 errors of the form: 'Public class blah blah blah must be defined in a file called blah blah blah' (I think these errors are thrown when the WLS is attempting to recompile my EJB JAR within the server, not sure about that though). The clinker is that if I change no source code, recompile and redeploy again, then occasionally I will not have the errors and everything will run fine from there on in. There have been times where I have gone through the hair pulling process of running my ant clean, ant build scripts, and attempting to deploy 10 times before all of the sudden Blamo, it works only to fail again the next time I need to recompile. Environment description --- 1. I edit source, compile and build WAR, EJB JAR, support class JAR, and EAR on Windows 2K using ant. I use the manifest.update feature to put class path info about classes used in both EJBs and Servlets into the EAR file. 2. ANT_HOME = \apache-ant-1.5.3Beta1 (also tried 1.5.2 and 1.5.1) 3. JAVA_HOME = \j2sdk_forte\jdk1.4.0 (also tried 1.3.1) 4. Attempting to deploy EAR to BEA Web Logic Server 6.1 sp4 (also tried sp2) running on a Sun server using WLS browser based admin tool. 5. The application uses Struts, log4j, rowtag among other things. Some Observations - 1. The size of my EAR file changes each time I run my ant build script. Looking inside the EAR I see that the compressed sizes of my WAR and EJB JAR, and support class JAR files change each time the EAR build is run (while the sizes of the original WAR and JARs remain the same - and the original and compressed sizes of all my 3rd party JARs also remain the same). 2. Also I notice that when the size of the EAR gets smaller then the app is more likely
how to deploy a simple struts application in iplanet webserver6.0
Hi, i am new to iplanet webserver 6.0 and struts.. i just tried a simple web appication with struts ActionServlet just it check the input and accordingly forward to different jsp.but i was not able to run the application .it is giving servelet exception while loading itself i am using only the ActionServlet, i am not using ActionForm my directory structure is : i have created a web app in server doc root(iplanet/server/doc) Test WEB-INF classes lib bin i have put action servlet inside classes dir i have given the mapping in web-apps.xml of virtual server. that is all i have done.. please help me to solve this problem Regards, P.RAMESHKUMAR, ** This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated. **
Testing your Struts Application
Can anybody point out some good automated testing strategies for Struts-based applications? Ideally, I'd like to run automated tests that simulate an end user: 1) filling out a form and testing for success and expected failure 2) clicking on a url that brings up a result set I know I could unit test some of my business and data layers, but that leaves out potential run-time errors that may exist in the JSP pages (like a typo for an html:text property=naame / tag). I'm really interested to know what automated testing is working for people, especially for larger web applications with more moving parts. Aaron - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Testing your Struts Application
several previous posts refer to this - might check it out: http://strutstestcase.sourceforge.net/ -jeff On Saturday, March 15, 2003, at 04:02 PM, Aaron O'Hara wrote: Can anybody point out some good automated testing strategies for Struts-based applications? Ideally, I'd like to run automated tests that simulate an end user: 1) filling out a form and testing for success and expected failure 2) clicking on a url that brings up a result set I know I could unit test some of my business and data layers, but that leaves out potential run-time errors that may exist in the JSP pages (like a typo for an html:text property=naame / tag). I'm really interested to know what automated testing is working for people, especially for larger web applications with more moving parts. Aaron - 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]
Data driven struts application
95% of my struts web apps follow this flow: 1. User selection in a JSP 2. Action class performs a SQL query 3. Return ActionForward to a new JSP that renders the query ResultSet What is the best practice to show SQL query results (ResultSet) to the user? (I mean how communication between view and controller should be when I do extensive use of ResulSets) Actually, we are including the ResultSet in the request :(, and processing it in the JSP (using a scriptlet). But I dont like this aproach very much, so I wonder if it would be better to: + solution 1. Use a RowSetDynaClass instead of the ResultSet. + solution 2. Use a JavaBean with getters and setters (maybe as database column names) and include a JavaBean collection in the request as a Value Object (?) + solution 3. I don't know... :( Thank you very much, Guido. PD. Is it better to use a collection of JavaBeans or use just one JavaBean whose properties return a collection?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Data driven struts application
Using a ResultSet directly is generally seen as bad practice. At a minimum you should probably use the ResultSetDynaClass then next in line would be a RowSetDynaClass, then JavaBeans. As for the JavaBean properties question, it would be easier to return a Collection of JavaBeans where each bean represented each row in the resultset. ~Robert Guido wrote: 95% of my struts web apps follow this flow: 1. User selection in a JSP 2. Action class performs a SQL query 3. Return ActionForward to a new JSP that renders the query ResultSet What is the best practice to show SQL query results (ResultSet) to the user? (I mean how communication between view and controller should be when I do extensive use of ResulSets) Actually, we are including the ResultSet in the request :(, and processing it in the JSP (using a scriptlet). But I dont like this aproach very much, so I wonder if it would be better to: + solution 1. Use a RowSetDynaClass instead of the ResultSet. + solution 2. Use a JavaBean with getters and setters (maybe as database column names) and include a JavaBean collection in the request as a Value Object (?) + solution 3. I don't know... :( Thank you very much, Guido. PD. Is it better to use a collection of JavaBeans or use just one JavaBean whose properties return a collection?? - 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: Data driven struts application
Both solution 1 and 2 are far better than using a ResultSet in a jsp. I usually use a Collection of JavaBeans. David From: Guido [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Data driven struts application Date: Fri, 14 Mar 2003 16:24:08 +0100 95% of my struts web apps follow this flow: 1. User selection in a JSP 2. Action class performs a SQL query 3. Return ActionForward to a new JSP that renders the query ResultSet What is the best practice to show SQL query results (ResultSet) to the user? (I mean how communication between view and controller should be when I do extensive use of ResulSets) Actually, we are including the ResultSet in the request :(, and processing it in the JSP (using a scriptlet). But I dont like this aproach very much, so I wonder if it would be better to: + solution 1. Use a RowSetDynaClass instead of the ResultSet. + solution 2. Use a JavaBean with getters and setters (maybe as database column names) and include a JavaBean collection in the request as a Value Object (?) + solution 3. I don't know... :( Thank you very much, Guido. PD. Is it better to use a collection of JavaBeans or use just one JavaBean whose properties return a collection?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Data driven struts application
I spent some time thinking over this very topic. I finally went with the following approach: * I used JDBC (NO Entity Beans got bitten bably there in the past) to query the data base and then created value objects which i then inserted into Form beans. * For read only data access i used an optimised SQL statement (plse see below) which returns only enough data to render the current screen to the client. As the user pages through the results i use the paging start index to control the SQL select statement so that i only ever fetch enough data for the next screen. So if the user pages from page 1 to 20, and i display 10 records per page i don't need to process from record 1 to 200 to get the data i need, nor do i need to keep my connection open. I always get back my data in blocks of 10 records. select [$ColumnNames], counter from ( select [$ColumnNames], rownum as counter from (select [$ColumnNames] from my_table where [$WhereClause])) where counter between [Start Index] and [End Index] The SQL could be optimised a little more Im not an SQL guru!!! I could also implement a caching mechanism to increase performance a little more. Any ways thats my two cents From: Robert McIntosh [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Data driven struts application Date: Fri, 14 Mar 2003 09:38:50 -0600 Using a ResultSet directly is generally seen as bad practice. At a minimum you should probably use the ResultSetDynaClass then next in line would be a RowSetDynaClass, then JavaBeans. As for the JavaBean properties question, it would be easier to return a Collection of JavaBeans where each bean represented each row in the resultset. ~Robert Guido wrote: 95% of my struts web apps follow this flow: 1. User selection in a JSP 2. Action class performs a SQL query 3. Return ActionForward to a new JSP that renders the query ResultSet What is the best practice to show SQL query results (ResultSet) to the user? (I mean how communication between view and controller should be when I do extensive use of ResulSets) Actually, we are including the ResultSet in the request :(, and processing it in the JSP (using a scriptlet). But I dont like this aproach very much, so I wonder if it would be better to: + solution 1. Use a RowSetDynaClass instead of the ResultSet. + solution 2. Use a JavaBean with getters and setters (maybe as database column names) and include a JavaBean collection in the request as a Value Object (?) + solution 3. I don't know... :( Thank you very much, Guido. PD. Is it better to use a collection of JavaBeans or use just one JavaBean whose properties return a collection?? - 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] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Data driven struts application
Yep, I agree with David. Your code will invariably be more usable and be more presentation layer friendly if you always return a Collection of some type. The Collection would contain beans of the object type you're working with. Further if you're using for example an ArrayList to populate a List, and later you decide you want to change it to something else for say performance reasons or what ever, you don't go busting the whole presentation layer because of it, since the presentation layer is working with a Collection and knows about nothing else. It is *sometimes* better to be as generic as possible with the underlying layers of your code, than hooking your presentation code in so tight that maintenance of the app is greatly affected. On Friday, March 14, 2003, at 10:57 AM, David Graham wrote: Both solution 1 and 2 are far better than using a ResultSet in a jsp. I usually use a Collection of JavaBeans. David From: Guido [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Data driven struts application Date: Fri, 14 Mar 2003 16:24:08 +0100 95% of my struts web apps follow this flow: 1. User selection in a JSP 2. Action class performs a SQL query 3. Return ActionForward to a new JSP that renders the query ResultSet What is the best practice to show SQL query results (ResultSet) to the user? (I mean how communication between view and controller should be when I do extensive use of ResulSets) Actually, we are including the ResultSet in the request :(, and processing it in the JSP (using a scriptlet). But I dont like this aproach very much, so I wonder if it would be better to: + solution 1. Use a RowSetDynaClass instead of the ResultSet. + solution 2. Use a JavaBean with getters and setters (maybe as database column names) and include a JavaBean collection in the request as a Value Object (?) + solution 3. I don't know... :( Thank you very much, Guido. PD. Is it better to use a collection of JavaBeans or use just one JavaBean whose properties return a collection?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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: Data driven struts application
On Fri, 14 Mar 2003, Robert McIntosh wrote: Date: Fri, 14 Mar 2003 09:38:50 -0600 From: Robert McIntosh [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Data driven struts application Using a ResultSet directly is generally seen as bad practice. At a minimum you should probably use the ResultSetDynaClass then next in line would be a RowSetDynaClass, then JavaBeans. As for the JavaBean properties question, it would be easier to return a Collection of JavaBeans where each bean represented each row in the resultset. Note that using ResultSetDynaClass doesn't get you out of leaving the underlying ResultSet open (and the connection allocated from your connection pool), so it is still not the best choice for making data available to the view tier. It's primary value is exposing ResultSet data as DynaBeans for processing inside the business tier. For maximum efficiency, no data copying is done -- it essentially synthesizes a DynaBean for the current row (have a look at the sources if you want to see the world's strangest Iterator implementation :-). RowSetDynaClass, on the other hand, is quite useful for making data available to the view tier. It makes a copy of the data, so the underlying result set can be immediately closed, and the connection returned to the connection pool. And, because it again exposes DynaBeans, all the standard Struts tags can deal with it just like a collection of standard JavaBeans. The only downside is that the copying can be computationaly and/or memory-wise expensive, so be sure you don't try things like performing a million row query and then trying to make a RowSetDynaClass out of it. ~Robert Craig McClanahan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Data driven struts application
I agree, but I am in doubt: 1. How to transform a ResultSet into a JavaBean (I think bean accesors don't have to be named as database columns...) without reinvent the wheel? 2. If I don't know how many columns the query returns (i.e. if the query is 'select * from ORACLE_VIEW') I supose I can use a DynaBean. Are there any other technique? Thank you again, Guido. Robert S. Sfeir wrote: Yep, I agree with David. Your code will invariably be more usable and be more presentation layer friendly if you always return a Collection of some type. The Collection would contain beans of the object type you're working with. Further if you're using for example an ArrayList to populate a List, and later you decide you want to change it to something else for say performance reasons or what ever, you don't go busting the whole presentation layer because of it, since the presentation layer is working with a Collection and knows about nothing else. It is *sometimes* better to be as generic as possible with the underlying layers of your code, than hooking your presentation code in so tight that maintenance of the app is greatly affected. On Friday, March 14, 2003, at 10:57 AM, David Graham wrote: Both solution 1 and 2 are far better than using a ResultSet in a jsp. I usually use a Collection of JavaBeans. David From: Guido [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Data driven struts application Date: Fri, 14 Mar 2003 16:24:08 +0100 95% of my struts web apps follow this flow: 1. User selection in a JSP 2. Action class performs a SQL query 3. Return ActionForward to a new JSP that renders the query ResultSet What is the best practice to show SQL query results (ResultSet) to the user? (I mean how communication between view and controller should be when I do extensive use of ResulSets) Actually, we are including the ResultSet in the request :(, and processing it in the JSP (using a scriptlet). But I dont like this aproach very much, so I wonder if it would be better to: + solution 1. Use a RowSetDynaClass instead of the ResultSet. + solution 2. Use a JavaBean with getters and setters (maybe as database column names) and include a JavaBean collection in the request as a Value Object (?) + solution 3. I don't know... :( Thank you very much, Guido. PD. Is it better to use a collection of JavaBeans or use just one JavaBean whose properties return a collection?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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: Data driven struts application
On Fri, 14 Mar 2003, Pat Quinn wrote: Date: Fri, 14 Mar 2003 16:05:34 + From: Pat Quinn [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Data driven struts application I spent some time thinking over this very topic. I finally went with the following approach: * I used JDBC (NO Entity Beans got bitten bably there in the past) to query the data base and then created value objects which i then inserted into Form beans. This is pretty much what RowSetDynaClass does for you, without the need to create classes for your value objects. * For read only data access i used an optimised SQL statement (plse see below) which returns only enough data to render the current screen to the client. This is almost always a really smart strategy -- not only should you limit which columns are retrieved to only those that meet the requirements, you should (more importantly) limit the number of rows that is retrieved, as Pat points out below. Two possible concerns are that you'll be tying the persistence tier and the view tier together, because (for example) the page author has to know about the column names in the database, and the business logic has to be tweaked every time the page author needs a new column added. To mitigate these problems, I suggest using two strategies: * Store the actual SQL query sources into properties files, so that it can be modified easily without touching the business logic classes. (This can also be a lifesaver if you have to support more than one database, where the SQL query syntax has to change slightly.) * Use the column aliasing capability of SQL (the as modifier) to convert the database column names into simple names that the page author can expect, and document (for him or her) only those names. For example, a query might say something like: select customer-account-number as account, external-display-name as name from customers where ...; and the page author will see properties named account and name, no matter what the database actually uses. As the user pages through the results i use the paging start index to control the SQL select statement so that i only ever fetch enough data for the next screen. So if the user pages from page 1 to 20, and i display 10 records per page i don't need to process from record 1 to 200 to get the data i need, nor do i need to keep my connection open. I always get back my data in blocks of 10 records. select [$ColumnNames], counter from ( select [$ColumnNames], rownum as counter from (select [$ColumnNames] from my_table where [$WhereClause])) where counter between [Start Index] and [End Index] The SQL could be optimised a little more Im not an SQL guru!!! I could also implement a caching mechanism to increase performance a little more. Any ways thats my two cents Craig McClanahan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Data driven struts application
I agree Craig, I'm actually storing my SQL in a properties file, and i use a singleton object to load cache it i didn't want to go into too much detail!!! Cheers for your other point with regards column names From: Craig R. McClanahan [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Data driven struts application Date: Fri, 14 Mar 2003 08:24:58 -0800 (PST) On Fri, 14 Mar 2003, Pat Quinn wrote: Date: Fri, 14 Mar 2003 16:05:34 + From: Pat Quinn [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Data driven struts application I spent some time thinking over this very topic. I finally went with the following approach: * I used JDBC (NO Entity Beans got bitten bably there in the past) to query the data base and then created value objects which i then inserted into Form beans. This is pretty much what RowSetDynaClass does for you, without the need to create classes for your value objects. * For read only data access i used an optimised SQL statement (plse see below) which returns only enough data to render the current screen to the client. This is almost always a really smart strategy -- not only should you limit which columns are retrieved to only those that meet the requirements, you should (more importantly) limit the number of rows that is retrieved, as Pat points out below. Two possible concerns are that you'll be tying the persistence tier and the view tier together, because (for example) the page author has to know about the column names in the database, and the business logic has to be tweaked every time the page author needs a new column added. To mitigate these problems, I suggest using two strategies: * Store the actual SQL query sources into properties files, so that it can be modified easily without touching the business logic classes. (This can also be a lifesaver if you have to support more than one database, where the SQL query syntax has to change slightly.) * Use the column aliasing capability of SQL (the as modifier) to convert the database column names into simple names that the page author can expect, and document (for him or her) only those names. For example, a query might say something like: select customer-account-number as account, external-display-name as name from customers where ...; and the page author will see properties named account and name, no matter what the database actually uses. As the user pages through the results i use the paging start index to control the SQL select statement so that i only ever fetch enough data for the next screen. So if the user pages from page 1 to 20, and i display 10 records per page i don't need to process from record 1 to 200 to get the data i need, nor do i need to keep my connection open. I always get back my data in blocks of 10 records. select [$ColumnNames], counter from ( select [$ColumnNames], rownum as counter from (select [$ColumnNames] from my_table where [$WhereClause])) where counter between [Start Index] and [End Index] The SQL could be optimised a little more Im not an SQL guru!!! I could also implement a caching mechanism to increase performance a little more. Any ways thats my two cents Craig McClanahan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Data driven struts application
I apologize if this has already been beaten to death, but I am still struggling with the implications of dyna-stuff on traditional OOD in struts applications. See interspersed. Craig R. McClanahan wrote: This is pretty much what RowSetDynaClass does for you, without the need to create classes for your value objects. Yes, but then you no longer have encapsulation at the business object level. If you short-circuit the persistence = business objects = view path, then either the view or the persistence layer is going to have to absorb both data abstraction and business logic. Unless what you mean is to use the RowSetDynaClass to populate your BOs...? Or...maybe there is a class of applications where persistence really can effectively absorb both data abstraction and business logic? * For read only data access i used an optimised SQL statement (plse see below) which returns only enough data to render the current screen to the client. This is almost always a really smart strategy -- not only should you limit which columns are retrieved to only those that meet the requirements, you should (more importantly) limit the number of rows that is retrieved, as Pat points out below. Two possible concerns are that you'll be tying the persistence tier and the view tier together, because (for example) the page author has to know about the column names in the database, and the business logic has to be tweaked every time the page author needs a new column added. To mitigate these problems, I suggest using two strategies: * Store the actual SQL query sources into properties files, so that it can be modified easily without touching the business logic classes. (This can also be a lifesaver if you have to support more than one database, where the SQL query syntax has to change slightly.) * Use the column aliasing capability of SQL (the as modifier) to convert the database column names into simple names that the page author can expect, and document (for him or her) only those names. For example, a query might say something like: select customer-account-number as account, external-display-name as name from customers where ...; and the page author will see properties named account and name, no matter what the database actually uses. But isn't this effectively still binding the view tier to the persistence tier? How do you handle derived fields? Using SQL to encapsulate business logic can lead to a maintenance nightmare. First come views, then stored procedures, then more database dependency than you ever wanted I can see how simple CRUD apps can be assembled VERY quickly using dyna-stuff tied directly to a SQL data model, with the model really just being the data model (with techniques like the above used to loosen the coupling a bit); but this brings back some *BAD* memories for me -- instant 2-tier applications using advanced data binding technologies having to be rewritten entirely when they needed to scale (either in terms of load or complexity). Am I just once bitten, twice shy here? Am I missing the point? Craig McClanahan - 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: Data driven struts application
An approach that I've used is to use the javax.servlet.jsp.jstl.sql ResultSupport and Result objects. I create a Result object from the ResultSet object in this line: lResult = ResultSupport.toResult(lResultSet); I then pass the Result to the jsp: aRequest.setAttribute(departments, lResult); And display it using the jstl taqs as follows: c:forEach var=department begin=0 items=${departments.rows} department namec:out value=${department.name}//name descriptionc:out value=${department.description}//description phonec:out value=${department.phone}//phone faxc:out value=${department.fax}//fax /department /c:forEach This allows me to close the Connection and keep the data alive (I think), so is this a good approach? Paul -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: 14 March 2003 11:16 To: Struts Users Mailing List Subject: Re: Data driven struts application On Fri, 14 Mar 2003, Robert McIntosh wrote: Date: Fri, 14 Mar 2003 09:38:50 -0600 From: Robert McIntosh [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Data driven struts application Using a ResultSet directly is generally seen as bad practice. At a minimum you should probably use the ResultSetDynaClass then next in line would be a RowSetDynaClass, then JavaBeans. As for the JavaBean properties question, it would be easier to return a Collection of JavaBeans where each bean represented each row in the resultset. Note that using ResultSetDynaClass doesn't get you out of leaving the underlying ResultSet open (and the connection allocated from your connection pool), so it is still not the best choice for making data available to the view tier. It's primary value is exposing ResultSet data as DynaBeans for processing inside the business tier. For maximum efficiency, no data copying is done -- it essentially synthesizes a DynaBean for the current row (have a look at the sources if you want to see the world's strangest Iterator implementation :-). RowSetDynaClass, on the other hand, is quite useful for making data available to the view tier. It makes a copy of the data, so the underlying result set can be immediately closed, and the connection returned to the connection pool. And, because it again exposes DynaBeans, all the standard Struts tags can deal with it just like a collection of standard JavaBeans. The only downside is that the copying can be computationaly and/or memory-wise expensive, so be sure you don't try things like performing a million row query and then trying to make a RowSetDynaClass out of it. ~Robert Craig McClanahan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Data driven struts application
I agree with those that say Dynabeans are not a good practice. It's hard to unit test, or reuse, for example in JSTL or Model 1. It has a CVS hot spot. etc. etc. Best stick with unit tested POJO (and a bean that has a DAO helper, as in my other posts). .V Phil Steitz wrote: I apologize if this has already been beaten to death, but I am still struggling with the implications of dyna-stuff on traditional OOD in struts applications. See interspersed. Craig R. McClanahan wrote: This is pretty much what RowSetDynaClass does for you, without the need to create classes for your value objects. Yes, but then you no longer have encapsulation at the business object level. If you short-circuit the persistence = business objects = view path, then either the view or the persistence layer is going to have to absorb both data abstraction and business logic. Unless what you mean is to use the RowSetDynaClass to populate your BOs...? Or...maybe there is a class of applications where persistence really can effectively absorb both data abstraction and business logic? * For read only data access i used an optimised SQL statement (plse see below) which returns only enough data to render the current screen to the client. This is almost always a really smart strategy -- not only should you limit which columns are retrieved to only those that meet the requirements, you should (more importantly) limit the number of rows that is retrieved, as Pat points out below. Two possible concerns are that you'll be tying the persistence tier and the view tier together, because (for example) the page author has to know about the column names in the database, and the business logic has to be tweaked every time the page author needs a new column added. To mitigate these problems, I suggest using two strategies: * Store the actual SQL query sources into properties files, so that it can be modified easily without touching the business logic classes. (This can also be a lifesaver if you have to support more than one database, where the SQL query syntax has to change slightly.) * Use the column aliasing capability of SQL (the as modifier) to convert the database column names into simple names that the page author can expect, and document (for him or her) only those names. For example, a query might say something like: select customer-account-number as account, external-display-name as name from customers where ...; and the page author will see properties named account and name, no matter what the database actually uses. But isn't this effectively still binding the view tier to the persistence tier? How do you handle derived fields? Using SQL to encapsulate business logic can lead to a maintenance nightmare. First come views, then stored procedures, then more database dependency than you ever wanted I can see how simple CRUD apps can be assembled VERY quickly using dyna-stuff tied directly to a SQL data model, with the model really just being the data model (with techniques like the above used to loosen the coupling a bit); but this brings back some *BAD* memories for me -- instant 2-tier applications using advanced data binding technologies having to be rewritten entirely when they needed to scale (either in terms of load or complexity). Am I just once bitten, twice shy here? Am I missing the point? Craig McClanahan - 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: Data driven struts application
On Fri, 14 Mar 2003, Phil Steitz wrote: Date: Fri, 14 Mar 2003 10:17:59 -0700 From: Phil Steitz [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Data driven struts application I apologize if this has already been beaten to death, but I am still struggling with the implications of dyna-stuff on traditional OOD in struts applications. See interspersed. Craig R. McClanahan wrote: This is pretty much what RowSetDynaClass does for you, without the need to create classes for your value objects. Yes, but then you no longer have encapsulation at the business object level. If you short-circuit the persistence = business objects = view path, then either the view or the persistence layer is going to have to absorb both data abstraction and business logic. This is certainly a valid concern at the point where you're talking about data that can be *updated* by a web application. However, it's reasonable to pay attention to the fact that well over 80% of the SQL statements executed by a typical webapp are SELECTs that are only grabbing data to be rendered in the UI. Forcing people to create BOs for all of that stuff seems like it doesn't add a ton of value add. Unless what you mean is to use the RowSetDynaClass to populate your BOs...? That's certainly feasible as well, although it probably adds an extra layer without much benefit -- the population code has to know about the persistence tier pretty intimately already. Or...maybe there is a class of applications where persistence really can effectively absorb both data abstraction and business logic? * For read only data access i used an optimised SQL statement (plse see below) which returns only enough data to render the current screen to the client. This is almost always a really smart strategy -- not only should you limit which columns are retrieved to only those that meet the requirements, you should (more importantly) limit the number of rows that is retrieved, as Pat points out below. Two possible concerns are that you'll be tying the persistence tier and the view tier together, because (for example) the page author has to know about the column names in the database, and the business logic has to be tweaked every time the page author needs a new column added. To mitigate these problems, I suggest using two strategies: * Store the actual SQL query sources into properties files, so that it can be modified easily without touching the business logic classes. (This can also be a lifesaver if you have to support more than one database, where the SQL query syntax has to change slightly.) * Use the column aliasing capability of SQL (the as modifier) to convert the database column names into simple names that the page author can expect, and document (for him or her) only those names. For example, a query might say something like: select customer-account-number as account, external-display-name as name from customers where ...; and the page author will see properties named account and name, no matter what the database actually uses. But isn't this effectively still binding the view tier to the persistence tier? How do you handle derived fields? Using SQL to encapsulate business logic can lead to a maintenance nightmare. First come views, then stored procedures, then more database dependency than you ever wanted Yes, it is tying the tiers together. Now, assume we did the right O-O design and created value objects in between. Isn't the design of those value objects (specifically, which properties you expose) just as tied to the persistence tier? And isn't the set of properties available to the view tier just as tied to the set of properties available through the value objects, whether it's exposed as a bean or a JDBC row? A very typical thing that happens when you're adding features to an existing app is that you need to make some additional dynamic data avalable. Using value objects, you have to modify the VO class *and* the SQL code that populates it. Using RowSetDynaClass, you get to bypass part of that work, and only update the SQL query. Note that I am *not* advocating doing the query itself in the view tier (i.e. the JSP page). What you want is that the page author sees a collection of beans representing the results of the query, passed as a request attribute. In fact, if you're using the Struts tags to iterate over the collection and extract properties from it, the page author cannot even *tell* whether it's really dynabeans or not (in other words, the back end developer can change the implementation choice without affecting the front end pages). That's the way it should be. (In fact, if you follow my previous suggestion and isolate your SQL queries into a properties file, you can often accomodate
RE: Data driven struts application
On Fri, 14 Mar 2003, Paul Pattison wrote: Date: Fri, 14 Mar 2003 12:28:04 -0500 From: Paul Pattison [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: Data driven struts application An approach that I've used is to use the javax.servlet.jsp.jstl.sql ResultSupport and Result objects. I create a Result object from the ResultSet object in this line: lResult = ResultSupport.toResult(lResultSet); I then pass the Result to the jsp: aRequest.setAttribute(departments, lResult); And display it using the jstl taqs as follows: c:forEach var=department begin=0 items=${departments.rows} department namec:out value=${department.name}//name descriptionc:out value=${department.description}//description phonec:out value=${department.phone}//phone faxc:out value=${department.fax}//fax /department /c:forEach This allows me to close the Connection and keep the data alive (I think), so is this a good approach? Yep ... it has the same benefit as RowSetDynaClass does (as long as you're running on a Servlet 2.3 / JSP 1.2 platform that JSTL required), plus it's easier to use JSTL tags (or EL expressions in JSP 2.0) to access the properties. Paul Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Data driven struts application
Thanks, Craig. I understand a lot better now, but I am still struggling a bit. What you seem to be saying is that for read-only access we can safely skip the value/business object encapsulation; but for updates, we should use real BOs. This asymmetry troubles me; though I see the appeal in terms of developer productivity. I still see the risk of becoming persistence-implementation dependent, however, even with externalized SQL and field name normalization using AS. I see how the Dynamic model easily accomodates adding new fields to views, etc; but what happens when you decide to re-engineer the data model or to bring in a new datasource altogether? Or when you need to add derived fields? Consider the following example. Suppose that I am developing an online banking site, enabling customers to do both inquiries and updates on their accounts. The account info is stored in an RDBMS and I use Dyna-stuff to hit the store directly (using a model-free BO) with SQL queries, quickly generating a flexible infrastructure for account data retrieval. For updates (only?) I develop a traditional middle tier, with BOs and VOs modelling the domain and encapsulating the business logic. All is well and good until my company acquires another bank that has a legacy back end. If my update BOs and VOs are cleanly defined, I will not have much of a problem engineering connectors to the new system so that the new accounts can look no different from the others; but I will be SOL for account retrieval (unless, once again, I am missing something). This example may seem contrived; but this kind of thing does happen. One more point on the adding fields topic. I understand and agree with the basic point that if you use VOs, you need to keep them in synch with the model and you also need to keep the view in synch with them and that takes time. It also forces some analysis to be done, adds compile-time type checking, enhances readability of code and makes it easier to keep track of what data elements are being used in what way by what functions (so that implications of changes to the underlying data can be understood and fully tested). Call me a geezer; but somehow I prefer UML to SQL for design documentation. If the only artifacts expressing the design of the read-only view are SQL properties files, how do you keep these consistent with the model expressed in the BOs/VOs for updates? I guess the best strategy depends on the expected lifetime and required extensibility of the application. Thanks again for the explanation. -Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Data driven struts application
On Fri, 14 Mar 2003, Phil Steitz wrote: Date: Fri, 14 Mar 2003 14:17:38 -0700 From: Phil Steitz [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Data driven struts application Thanks, Craig. I understand a lot better now, but I am still struggling a bit. What you seem to be saying is that for read-only access we can safely skip the value/business object encapsulation; but for updates, we should use real BOs. This asymmetry troubles me; though I see the appeal in terms of developer productivity. I still see the risk of becoming persistence-implementation dependent, however, even with externalized SQL and field name normalization using AS. I see how the Dynamic model easily accomodates adding new fields to views, etc; but what happens when you decide to re-engineer the data model or to bring in a new datasource altogether? Or when you need to add derived fields? There's no question that you risk misbehaving ... but remember two things that are critically important about my suggestion: The page author has no clue that the ResultSetDynaClass instance you passed was delivered directly from the JDBC query ... to him/her, it just looks like a List of beans. The business tier is still responsible for *creating* that List of objects, and placing it in an appropriate request parameter. The business tier author can change that implementation to use real VOs, or pull the data from EJBs or an LDAP directory server instead, with zero impact on the page author or the code in the page. Therefore, I would contend that my solution is no more tied to the persistence tier than VO-based solutions are (i.e. you have to agree on the property names). Consider the following example. Suppose that I am developing an online banking site, enabling customers to do both inquiries and updates on their accounts. The account info is stored in an RDBMS and I use Dyna-stuff to hit the store directly (using a model-free BO) with SQL queries, quickly generating a flexible infrastructure for account data retrieval. For updates (only?) I develop a traditional middle tier, with BOs and VOs modelling the domain and encapsulating the business logic. All is well and good until my company acquires another bank that has a legacy back end. If my update BOs and VOs are cleanly defined, I will not have much of a problem engineering connectors to the new system so that the new accounts can look no different from the others; but I will be SOL for account retrieval (unless, once again, I am missing something). This example may seem contrived; but this kind of thing does happen. My bank has a similar application (shudder ... they even used Struts to build it ... :-). The app provides a combination of data I can modify (change my profile, transfer money back and forth, etc.) and a whole bunch of read-only data (all the current transactions, the account balances on all the other accounts, and so on). The quantity of modifiable data is a very small percentage of the total amount of dynamic data that is present. And, any effort to build VOs that support modification of all that other data would be overkill (for this app, although you might be able to use it elsewhere). Even if you adopt my suggestion to use RowSetDynaClass, you should hide that actual logic behind a DAO of some sort, so that the Action calling it doesn't know where the data came from either. One more point on the adding fields topic. I understand and agree with the basic point that if you use VOs, you need to keep them in synch with the model and you also need to keep the view in synch with them and that takes time. It also forces some analysis to be done, adds compile-time type checking, enhances readability of code and makes it easier to keep track of what data elements are being used in what way by what functions (so that implications of changes to the underlying data can be understood and fully tested). Call me a geezer; but somehow I prefer UML to SQL for design documentation. If the only artifacts expressing the design of the read-only view are SQL properties files, how do you keep these consistent with the model expressed in the BOs/VOs for updates? If all of us were this disciplined, there would be a lot fewer software bugs in the world :-). Unfortunately, there's lots of people who do things quick and dirty -- I'm trying to help them without giving up totally on MVC principles :-). I guess the best strategy depends on the expected lifetime and required extensibility of the application. Yep. Thanks again for the explanation. -Phil Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
First point of access to a struts application.
Hi all, I am struggling on creating a start access point to my struts/strutscx application. I need to fill in a bean with some relevant page data for the login page. This will be the start point for all access to the application. HOWEVER! I am not using jsp (at all) or html pages in a prewritten form, all output to the user will be generated from an Action class and the html generated using xslt. So I am currently wondering what is the best way to get the first page to the user. Should I have an Action class that is dedicated to presenting a first page that contains a login form, and then that form will cause a forward to the loginAction (which checks the user input) on clicking the submit button. Or would it be better to have the whole login page presentation, and loginAction within the same loginAction class? If so, how in the loginAction will it know that the user is new to the site and should therefore display a new login form? Kind regards Simon. Institut fuer Prozessdatenverarbeitung und Elektronik, Forschungszentrum Karlsruhe GmbH, Postfach 3640, D-76021 Karlsruhe, Germany. Tel: (+49)/7247 82-4042 E-mail : [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JOX Parser Conflicts with Struts Application
Hi, everybody, I was wondering if any1 has used the JOX parser from www.wutka.com/jox with a struts application, and if there were any conflicts. I am trying to call the JOX from a bean and in my browser getting an 500-exception, the debug shows that a Jasper Exception is thrown, which does not tell me much since thats the generic JSP engine (Tomcat) exception. My thinking is that it conflicts in some way with the way the beans are loaded with struts(not sure if that makes any sence, been using struts for a total of one week so far :)). I was going to use the digester to parse my xml and populate beans, but my understanding is that it uses xPath and i am not sure if i would like to implement it because of its slowdown...BTW, i am open to any suggestion on other ways to parse xml using SAX, so please feel free to give ideas. Thanks, Alex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JOX Parser Conflicts with Struts Application
Nevermind, problem solved :) But i still would like to hear about some xml techniques, please -Original Message- From: Alex Reznik [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 19, 2003 10:51 AM To: 'Struts Users Mailing List' Subject: JOX Parser Conflicts with Struts Application Hi, everybody, I was wondering if any1 has used the JOX parser from www.wutka.com/jox with a struts application, and if there were any conflicts. I am trying to call the JOX from a bean and in my browser getting an 500-exception, the debug shows that a Jasper Exception is thrown, which does not tell me much since thats the generic JSP engine (Tomcat) exception. My thinking is that it conflicts in some way with the way the beans are loaded with struts(not sure if that makes any sence, been using struts for a total of one week so far :)). I was going to use the digester to parse my xml and populate beans, but my understanding is that it uses xPath and i am not sure if i would like to implement it because of its slowdown...BTW, i am open to any suggestion on other ways to parse xml using SAX, so please feel free to give ideas. Thanks, Alex - 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: error when trying to deploy struts application onto JBoss 3.0.4
At 21:46 21/01/2003 +0100, you wrote: Have you try to add struts into jboss/server/default/lib ? I just tried that and it threw the same error on deployment. Are there known issues with this latest version of Struts and JBoss? I have successfully deployed things using Struts 1.0.2 and using templates but I am trying to use Tiles instead in the newer version of struts but can't get it to deploy. Rachel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
struts application and skins
I want to create an application that changes the skin of the application based on the url the application is accessed from. For example, if a user accesses the appliation from www.foo.com then i want to use foo.css the CSS and /image/foo/ for all images on the page. If a user accesses the application from www.bar.com then i want to use bar.css for the cSS and /images/bar/ for all images on the page. I am fairly new with struts and haven't had a whole lot of luck coming up with a good design of how to accomplish this. Has anyone tried to do something similar? What would be the best/a good way of going about this? Thanks. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: struts application and skins
You could setup a filter that checked the requested domain name and set the root path to your resources into a ServletContext attribute accordingly. You could use that variable in your jsps to generate urls to your skins. David From: AJ Scarbrough [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: struts application and skins Date: Wed, 22 Jan 2003 18:56:01 -0500 I want to create an application that changes the skin of the application based on the url the application is accessed from. For example, if a user accesses the appliation from www.foo.com then i want to use foo.css the CSS and /image/foo/ for all images on the page. If a user accesses the application from www.bar.com then i want to use bar.css for the cSS and /images/bar/ for all images on the page. I am fairly new with struts and haven't had a whole lot of luck coming up with a good design of how to accomplish this. Has anyone tried to do something similar? What would be the best/a good way of going about this? Thanks. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
error when trying to deploy struts application onto JBoss 3.0.4
I am trying to deploy a simple Struts Application onto JBoss 3.0.4 with Tomcat 4.1.12 (on Solaris). I'm getting the following error message during the deployment process: ERROR: [ActionServlet] Parsing error processing resource path java.io FileNotFoundException: JAR Entry org/apache/struts/resources/struts-config_1_1.dtd Not found in /opt/sfw/jboss/tomcat-4.1.x/work/MainEngine/localhost/_/WEB-INF/lib/struts.jar I am using the latest Struts (1.1b3) and also tried using a nightly build (19/01) after seeing a slightly similar error on Google. The dtd is definately on the path that it claims to not be able to find it on. Any ideas of how to get round this would be greatly appreciated. Thanks Rachel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: error when trying to deploy struts application onto JBoss 3.0.4
Hi, I had succefull deployement only with JBoss 3.0.4 + Jetty + jdk 1.3.1 not with the release with tomcat and only with jdk 1.4.1. -- Alexandre Jaquet - -BEGIN GEEK CODE BLOCK- Version: 3.12 GCM d+ s: a-- C U*+ P L--- E--- W+++ N+++ o K w+ O M-- V-- PS+++ PE+++ Y+++ PGP--- 5-- X R* tv b DI--- D G++ e* h++ r% y* --END GEEK CODE BLOCK-- - Original Message - From: Rachel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 21, 2003 9:50 PM Subject: error when trying to deploy struts application onto JBoss 3.0.4 I am trying to deploy a simple Struts Application onto JBoss 3.0.4 with Tomcat 4.1.12 (on Solaris). I'm getting the following error message during the deployment process: ERROR: [ActionServlet] Parsing error processing resource path java.io FileNotFoundException: JAR Entry org/apache/struts/resources/struts-config_1_1.dtd Not found in /opt/sfw/jboss/tomcat-4.1.x/work/MainEngine/localhost/_/WEB-INF/lib/struts.j ar I am using the latest Struts (1.1b3) and also tried using a nightly build (19/01) after seeing a slightly similar error on Google. The dtd is definately on the path that it claims to not be able to find it on. Any ideas of how to get round this would be greatly appreciated. Thanks Rachel -- 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]