Debugging
Is there anyway to output simple debugging info to a console or something? I need something that is consistant between my struts components and the beans and stuff that contain all of my business logic. -gerald
RE: Debugging
-Original Message- From: Gerald Hanks [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 9:32 AM To: [EMAIL PROTECTED] Subject: Debugging Is there anyway to output simple debugging info to a console or something? I need something that is consistant between my struts components and the beans and stuff that contain all of my business logic. -gerald Hi Gerald, what you want, is log4j. Find it at http://jakarta.apache.org/log4j. I use this for both development debugging and production logging, and it works great! Mark Mark Schenk | Ceci n'est pas une signature Blackboard Project Manager | Delft University of Technology |E-mail: [EMAIL PROTECTED] Dept.: DTO |Phone: +31 152785448 (85448) Room: LB00.680 |Fax:+31 152786359 -
RE: Debugging
Is there anyway to output simple debugging info to a console or something? I need something that is consistant between my struts components and the beans and stuff that contain all of my business logic. I'll probably get yelled at for this, but I just use System.err.println() and it works fine with Tomcat. Devon
RE: Mulitpage form support.
When I remove the reset method, I see the behavior that I am looking for. This makes it pretty easy to do mulitpage forms. Thanks for your help. This has also tripped me up and, from the looks of the mailing list archives, many other people. It seems like a good fix would be to have an attibute in the action configuration which indicates whether the input form should be fresh (call reset) or not. Devon
RE: Running the example application that comes along with struts
I have got a problem in running the example struts application. When I run my application , I get the first jsp page , i.e. index.jsp containing MailReader Demonstration Application Options, but when I click on any of the other links, I get this exception , org.xml.sax.SAXParseException: Relative URI struts-config_1_1.dtd; can not be resolved without a document URI. I don't know what this means. Please advise. The format of an XML file is defined by a DTD file. If you have an XML file, you can verify that it is legal by validating it against its DTD defintion. Your error message indicates that your web server is trying to verify the legality of the struts-config.xml file against its DTD file (which is defined at the top of that file). It is having trouble doing so because it can't find that DTD file. The solution to this problem is specific to your web server but it comes up often on this mailing list so maybe the archives could help you. Devon
Q: Struts with EJB's
Hi, I am planning to use struts as presentation framework. All of business logic resides in the form of session and entity beans. I want to initialise ejb homeobjects at the start of action servlet. Can anybody tell me to have optimum approach to do this. Thanks Sanjay Shell International Trading Shipping Company Limited ShellMex House, Strand, London WC2R 0ZA, United Kingdom *Tel. +44 (0)207-546 2278 * E-mail: [EMAIL PROTECTED]
Handling exceptions thrown from Action.perform in the errorpage?
Hey there! I have a question for you guys. When an exception is thrown in my Action derivative I want that exception to be handled by the errorpage (%@ page isErrorPage=true %). After fooling around with the web.xml file adding entries such as: error-page exception-typejavax.servlet.ServletException/exception-type location/errorpage.jsp/location /error-page the result is that when I throw a ServletException from the Action.perform method I'm directed to my login page(?!). I've tried using the mapping.findForward approach, as in: public final ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ActionForward af = null; try { af = doPerform(...); // throws exception } catch(Throwable t) { request.setAttribute(javax.servlet.jsp.jspException, new ServletException(t)); af = mapping.findForward(error); } return af; } ofcourse, I added: !-- == Global Forward Definitions == -- global-forwards forward name=errorpath=/errorpage.jsp/ /global-forwards to the struts-config.xml file. That didn't work either. The only approach that seems to work for me is: public final ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { try { return doPerform(...); // throws exception } catch(Throwable t) { request.setAttribute(javax.servlet.jsp.jspException, t); getServlet().getServletContext().getRequestDispatcher (/errorpage.jsp).forward(request, response); } } Now my questions are: Is this last approach safe to use with Struts? How do you guys accomplish this? Do you use a different approach altogether? TIA, S. Bro
Re: Baisc q 2 Cannot find message resources u/key -
No i am using tomcat 3.2.2. Cheers Chuck Jon Brisbin wrote: are you using tomcat 4? i get this message in tomcat 4 with struts applications as well... it's an issue with catalina working with struts, though i can't get anyone to help me figure out what it is... Jon Brisbin - Original Message - From: Chuck Amadi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 23, 2001 10:49 AM Subject: Re: Baisc q 2 Cannot find message resources u/key - Hi , in my wem.xml i have the following defined for the apllication init-param. init-param param-nameapplication/param-name param-valuehelloworld.HelloWorldResources/param-value /init-param load-on-startup1/load-on-startup /servlet Tried the second option previously and again no joy. The first option can i drag drop into the classes .jar the property file as all my jar's are in my WEB-INF/lib dir. Cheers Chuck Peter Alfors wrote: In your web.xml, what do you have defined for the application init-param? where is your properties file located? You have a couple of options: You could place the properties file in your classes jar (in the appropriate directory structure) or you can place it in the WEB-INF/classes directory (within the appropriate directory structure specified in the application init-param). Pete Chuck Amadi wrote: Hi , can anyone work out this one i have followed the correct procedures albeit i am missing somthing. (bbnpa the name of my application) My path C:\jakarta-tomcat\webapps\bbnpa\helloworld\hello.jsp 1) declared directives. 2) created property file. 3) created web.xml file. 4)Copied all necessary .tld to /helloworld/WEB-INF/ 5)Copied all necessary .jar's to /WEB-INF/lib 6)Copied and deployed the struts-trailmap war's to /bbnpa/ my app's dir. Wats left error below Error: 500 Location: /bbnpa/helloworld/hello.jsp Internal Servlet Error: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE Cheers Chuck. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
Re: Baisc q 2 Cannot find message resources u/key -
Yes my property file is located there. Cheers Chuckie. Peter Alfors wrote: Is your property file then located here ? WEB-INF/classes/helloword/HelloWorldResources.properties Pete Chuck Amadi wrote: Hi , in my wem.xml i have the following defined for the apllication init-param. init-param param-nameapplication/param-name param-valuehelloworld.HelloWorldResources/param-value /init-param load-on-startup1/load-on-startup /servlet Tried the second option previously and again no joy. The first option can i drag drop into the classes .jar the property file as all my jar's are in my WEB-INF/lib dir. Cheers Chuck Peter Alfors wrote: In your web.xml, what do you have defined for the application init-param? where is your properties file located? You have a couple of options: You could place the properties file in your classes jar (in the appropriate directory structure) or you can place it in the WEB-INF/classes directory (within the appropriate directory structure specified in the application init-param). Pete Chuck Amadi wrote: Hi , can anyone work out this one i have followed the correct procedures albeit i am missing somthing. (bbnpa the name of my application) My path C:\jakarta-tomcat\webapps\bbnpa\helloworld\hello.jsp 1) declared directives. 2) created property file. 3) created web.xml file. 4)Copied all necessary .tld to /helloworld/WEB-INF/ 5)Copied all necessary .jar's to /WEB-INF/lib 6)Copied and deployed the struts-trailmap war's to /bbnpa/ my app's dir. Wats left error below Error: 500 Location: /bbnpa/helloworld/hello.jsp Internal Servlet Error: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE Cheers Chuck. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
RE: Baisc q 2 Cannot find message resources u/key -
give this a try.. add the classes folder to classpath... -Original Message- From: Chuck Amadi [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 10:19 AM To: [EMAIL PROTECTED] Subject: Re: Baisc q 2 Cannot find message resources u/key - Hi i still get the following error message. My path is /bbnpa/helloworld/WEB-INF/classes/helloworld/HelloWorldResources.properties Any more pointers Cheers Chuck Error: 500 Location: /bbnpa/helloworld/hello.jsp Internal Servlet Error: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE Chuck Amadi wrote: Hi , can anyone work out this one i have followed the correct procedures albeit i am missing somthing. (bbnpa the name of my application) My path C:\jakarta-tomcat\webapps\bbnpa\helloworld\hello.jsp 1) declared directives. 2) created property file. 3) created web.xml file. 4)Copied all necessary .tld to /helloworld/WEB-INF/ 5)Copied all necessary .jar's to /WEB-INF/lib 6)Copied and deployed the struts-trailmap war's to /bbnpa/ my app's dir. Wats left error below Error: 500 Location: /bbnpa/helloworld/hello.jsp Internal Servlet Error: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE Cheers Chuck. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi. -- The information in this Internet email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this Internet email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this Internet email are subject to the terms and conditions expressed in any applicable governing ING Barings' terms of business or client engagement letter. Visit us at www.ingbarings.com --
Re: Handling exceptions thrown from Action.perform in the errorpage?
global-forwards forward name=errorpath=/errorpage.jsp/ /global-forwards return mapping.findForward(error) Will forward to the file named errorpage.jsp in the root of your Web application. If it doesn't, something else is wrong, like doPerform is not throwing the exception (Try logging it too.), or the page is in the root of your container instead, et cetera. Meanwhile, when saving exceptions for display on a JSP, you might use Action.EXCEPTION_KEY for the attribute key. The custom tags use this, and so your page would also display any exceptions the tags throw. (See saveException() in util.RequestUtils) [EMAIL PROTECTED] wrote: Hey there! I have a question for you guys. When an exception is thrown in my Action derivative I want that exception to be handled by the errorpage (%@ page isErrorPage=true %). After fooling around with the web.xml file adding entries such as: error-page exception-typejavax.servlet.ServletException/exception-type location/errorpage.jsp/location /error-page the result is that when I throw a ServletException from the Action.perform method I'm directed to my login page(?!). I've tried using the mapping.findForward approach, as in: public final ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ActionForward af = null; try { af = doPerform(...); // throws exception } catch(Throwable t) { request.setAttribute(javax.servlet.jsp.jspException, new ServletException(t)); af = mapping.findForward(error); } return af; } ofcourse, I added: !-- == Global Forward Definitions == -- global-forwards forward name=errorpath=/errorpage.jsp/ /global-forwards to the struts-config.xml file. That didn't work either. The only approach that seems to work for me is: public final ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { try { return doPerform(...); // throws exception } catch(Throwable t) { request.setAttribute(javax.servlet.jsp.jspException, t); getServlet().getServletContext().getRequestDispatcher (/errorpage.jsp).forward(request, response); } } Now my questions are: Is this last approach safe to use with Struts? How do you guys accomplish this? Do you use a different approach altogether? TIA, S. Bro -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/
Re: Struts + Tomcat/Apache (again)
its JkMount /*.do ajp13 remember the / this needs to be added as follows to your httpd conf. JkMount /*.jsp ajp13 JkMount /*.do ajp13 JkMount /servlet/* ajp13 Rakesh Ayilliath (Software Engineer) Synergy IT Innovations Pvt Ltd, #196, 1st Floor, 9th Cross, HMT Layout, RT Nagar Bangalore 560032 [EMAIL PROTECTED] www.ayilliath.8m.com - Original Message - From: Chuong Huynh [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 10:31 AM Subject: Struts + Tomcat/Apache (again) Hi all, There were some discussion about this matter but I can't find a workable answer. I still can't manage to make Strut work on Tomcat with Apache: the server can't understand .do extension (using Tomcat alone work fine). I've followed the doc carefully, and also followed the advise on the mailing list: add the line JkMount *.do ajp12 to the config file, and the problem is still the same: HTTP 404 - File not found Could anyone please help me. By the way, I used: Apache 1.3.17 Tomcat 3.2.2 Strut 1.0 Thanks, - Chuong = HUYNH, N. CHUONG TMA Software Solutions, Vietnam Tel: (84-8) 990 3848 - Ext: 5272 Email: [EMAIL PROTECTED] =
Re: Baisc q 2 Cannot find message resources u/key -
Hi, I have tried that thanks. Cheers Chuck [EMAIL PROTECTED] wrote: give this a try.. add the classes folder to classpath... -Original Message- From: Chuck Amadi [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 10:19 AM To: [EMAIL PROTECTED] Subject: Re: Baisc q 2 Cannot find message resources u/key - Hi i still get the following error message. My path is /bbnpa/helloworld/WEB-INF/classes/helloworld/HelloWorldResources.properties Any more pointers Cheers Chuck Error: 500 Location: /bbnpa/helloworld/hello.jsp Internal Servlet Error: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE Chuck Amadi wrote: Hi , can anyone work out this one i have followed the correct procedures albeit i am missing somthing. (bbnpa the name of my application) My path C:\jakarta-tomcat\webapps\bbnpa\helloworld\hello.jsp 1) declared directives. 2) created property file. 3) created web.xml file. 4)Copied all necessary .tld to /helloworld/WEB-INF/ 5)Copied all necessary .jar's to /WEB-INF/lib 6)Copied and deployed the struts-trailmap war's to /bbnpa/ my app's dir. Wats left error below Error: 500 Location: /bbnpa/helloworld/hello.jsp Internal Servlet Error: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE Cheers Chuck. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi. -- The information in this Internet email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this Internet email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this Internet email are subject to the terms and conditions expressed in any applicable governing ING Barings' terms of business or client engagement letter. Visit us at www.ingbarings.com -- -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
Re: Workflow impasse? New ideas.
As it stands, the Struts ActionMappings are already very nearly workflows. To close the loop, I believe we only need a few things. 1) A way to declare prerequesite actions. 2) A way to bookmark an Action, so the workflows can be rentrant. 3) A way to declare the html:form Action path at runtime. Given these capabilities, and a simple support structure, a set of ActionMappings can be linked together to form a robust workflow that can reuse input forms. Matthias Bauer has code for (1), http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg01685.html and Martin Cooper has a plan for ActionRequests that sound good for (2). http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02398.html As for (3), I have a hack in place now, http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02374.html but was waiting on Martin's ActionRequests before thinking seriously about integrating the mechanism into the framework. Craig is also reviewing some airplane notes http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02439.html he has about a scripting mechanism that might also be used for workflows. In the end, I think a workflow will look like another set of ActionMappings, and the Action will just contain some extra logic for returning the correct ActionForward if the flow gets out of synch. In the meantime, I do like the ideas that are coming up on this thread. Jonathan Asbell wrote: Hello all. I just got back and was reading the e-mails about workflows. By the tone and lack of dialog I think that we are not sure how we really want to design workflows still. So lets have more discussion on the subject. When its clearer we will better know what we want to do.
RE: code reuse
The previous response was thought provoking and may answer my specific concerns, but I don't see my way through the issues yet. Let me be more specific so that we can dive into the issues that I face: Currently, we have developed a full featured demo with two main wizards - 1) Account Maintenance (4 screens) 2) Order Management ( 8 main screens with ~20 minor screens) We have an Account Maintenance Form (about 50 properties) and an Order form (about 250 properties). Each Account Maintenance screen has its' own Action class feeding a segment of the Account Maintenance Form. The Order Management wizard has one main Action class with a couple of helper classes to manage the 8 main screens (work flow) all feeding the Order Form. The Order Form is also feed by a the 20 minor screens which each have their own small Action class. One of the minor Order screens is the Corporate Info screen (mainly address info)- it is designed to be a popup screen that can be called from within the Order wizard or the Account Maintenance wizard. However, it isn't implemented as an independent Action/Form because we don't know how to make the Order Form AND the Account Mntc Form both reuse the Corporate Info Form/Action. Specifically, we don't know how to implement such that the Action class for Corporate Info can be reused by both the Order and Account wizards. So, today the same fields are duplicated in the two wizards and all the code is duplicated (ugly!). We can envision a wrapper form that contains other forms and uses a dot notation in the JSPs to reference properties (orderForm.corporateInfoForm.address) but how do the Action classes for CorporateInfo get reused? There seems to be such tight coupling between an ActionForm and an Action Class that I don't know how to achieve reuse. I played with creating an IAddress Action interface that both the Order and Account wizards could implement but got caught up in the coupling issues. Thanks! ...Steve -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 22, 2001 3:19 PM To: [EMAIL PROTECTED] Subject: Re: code reuse I would say that if you have one EJB for all these properties, then you should have one ActionForm as well. The trick to ActionForm reuse is the validation method. If the class is used on more than one form, then validate() may need to address a different set of properties. If you are using the ValidatorForm, it has a page property. Each formset can have its own page name, and can validate only the properties relevant to that formset. Otherwise, validate() is passed the ActionMapping, and you can use that to determine your own form sets. Some developers also use hidden fields for the same purpose. Of course, if only one form is used for data-entry, validating more than one form may not be an issue. Once you have an ActionForm that you can use on more than one form, you can also use the same Action to handle them all. Since Actions are multithreaded and cached by the framework, fewer Actions can mean a better deployment. I'm often tempted to try designing an application around a single ActionForm and Action. This may make for a more efficient Struts application, but may also lead to maintenance issues. In general, I tend to design my applications around packages or modules. The package may offer several operations and JSP views, but use only one Action and ActionForm for them all. My favorite way to use an Action with several operations is to use a separate ActionMapping for each. An easy way to tell one mapping during processing from another is to use the parameter property to give each a logical name. action parameter=select path=/donor/Search type=org.wxxi.gavel.donor.http.Client name=donorForm scope=request validate=false forward name=continue path=/WEB-INF/pages/donor/Result.jsp/ /action action parameter=select path=/donor/View type=org.wxxi.gavel.donor.http.Client name=donorForm scope=request validate=false forward name=continue path=/WEB-INF/pages/donor/View.jsp/ /action In perform() or validate(), you can call mapping.getParameter(), and call the appropriate operation. The parameter property was originally introduced to support the optional DispatchAction class. This uses reflection to call a different perform() method for each operation. This is a nifty feature, and I do something similar by subclassing Actions and giving the ancestors a utility method to handle stadnard operators, across a package or even the entire application. The current DispatchAction expects the Action to be called using a syntax like http://localhost:8080/myapp/saveSubscription.do?method=update where method is set as the parameter property. The Action then dispatches this call to a public method with the signature public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException As
Re: How to integrate flash request into struts ...
Since loadVariables is an internal flash call, I imagine the problem will most likely be in flash, and not with JSPs. What you can try is to reconfigure your mappings so that *.asp will be treated as a JSP, and rename your JSP files to *.asp. If this works, it means flash (or the flash host - IE or other flash runner) is doing some extension processing and doesn't handle the jsp extension properly. Another thing to check is that the HTTP headers written when using the JSP solution is comparable to what the working CGI or ASP solution is writing. Good luck. Calvin On 23 Jul 2001 20:02:40 +0200, Philippe Dion wrote: Hello! I have a problem. A strange problem. I'm new to struts tougth i have a strong programming background. I wish to use flash with struts. What I want is to use the loadVariables function of flash. What this function do is to open a http connection to the server and read and process the stdout.(println in jsp). To do that i connect to a jsp file and pass variables in the http header (just as any HTML form) to the jsp. My problem is the jsp file redirect the swf to the jsp and load the jsp in place of the swf. Can you help? Are there a way to connect and read to the jsp script without reloading the page just as I can do with ASP??? This trick work fine with ASP,CGI and other. What I would do in CGI is to write a script reading the query string and print out on the stdout. Without the swf to be reloading. Thank for any help or for pointing me somewhere I can find a solution!! Pi Guy
Re: Forwarding/redirecting to action mappings rather than directly to JSPs
Matt I got my code to work by removing the mapping from the request before forwarding from my action classes with the following line request.removeAttribute(Action.MAPPING_KEY); Prior to that it seemed that the previous mapping was not being overwritten by the ActionServlet. Hope this helps Jim - Original Message - From: Matt Raible To: [EMAIL PROTECTED] Sent: Friday, July 20, 2001 4:51 AM Subject: Forwarding/redirecting to action mappings rather than directly to JSPs Jim, Did you ever get this post figured out Im having a similar problem with iPlanet. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg11046.html Thanks, Matt
[answer to the question] how to access beans collected in hashtable?
Hi, who knows how to iterate a hashtable and access its value-objects (beans with some properties)? I can reach the beans in the hashtable: logic:iterate id=element name=myhashtable property=table/ bean:write name=element property=value/ /logic:iterate But I don't know how to reach the properties of the beans. Any idea?? --- Yeah, just before I pressed the send butten we got it! ---: logic:iterate id=element name=myhashtable property=table/ bean:write name=element property=value.name/ /logic:iterate Cheers Hartmut
what setters do i implement in an indexed tag ?
I've created a page using indexed tags (neat stuff!). Here is what is currently working for me: o If i populate the form's vector, values from that vector are displayed in the jsp Here is what it not working: o when the form is posted back, the vector is null (in the struts perform() method) I suspect i haven't implemented some sort of setter within the form but i can't find an example as to what method should be implemented. I've tried ArrayList and using parameterList instead with no different result. Thanks, Waz. =) Here are some code snippits for help: ---jsp--- logic:iterate id=mappings name=FieldsMapForm property=fieldMappings html:text name=mappings property=attributeCode indexed=true/ br /logic:iterate ---Form--- public class FieldsMapForm extends ActionForm { private String fileColCount; private java.util.Vector fieldMappings = new java.util.Vector(); private String action; public String getFileColCount() { return fileColCount; } public void setFileColCount(String newFileColCount) { fileColCount = newFileColCount; } public void setFieldMappings(java.util.Vector newFieldMappings) { fieldMappings = newFieldMappings; } public java.util.Vector getFieldMappings() { return fieldMappings; } public FieldMapping getParameter(int index) { return (FieldMapping)fieldMappings.elementAt(index); } public void setAction(String newAction) { action = newAction; } public String getAction() { return action; } public void reset(ActionMapping mapping, HttpServletRequest request) { fileColCount = null; fieldMappings = new java.util.Vector(); action = null; } } ---The vector contains these:--- public class FieldMapping implements Serializable { private Integer fieldNumber; private String attributeCode; public void setFieldNumber(Integer newFieldNumber) { fieldNumber = newFieldNumber; } public Integer getFieldNumber() { return fieldNumber; } public void setAttributeCode(String newAttributeCode) { attributeCode = newAttributeCode; } public String getAttributeCode() { return attributeCode; } }
Mappings, bloody mappings
I have problem... It might be in my understanding, but here it goes... I have these mappings: form-beans form-bean name=FundUpdateForm type=com.projectcast.sfundm.FundForm/ /form-beans global-forwards forward name=funds path=/fundlist.do/ /global-forwards action-mappings action path=/fundlist type=com.projectcast.sfundm.FundListAction scope=request forward name=success path=/WEB-INF/web/fundlist.jsp/ forward name=failure path=/WEB-INF/web/fundlist.jsp/ /action action path=/editfund type=com.projectcast.sfundm.FundSelectAction scope=request forward name=success path=/WEB-INF/web/editfund.jsp/ forward name=failure path=/WEB-INF/web/editfund.jsp/ forward name=cancel path=/funds.do/ /action action path=/updatefund type=com.projectcast.sfundm.FundUpdateAction name=FundUpdateForm scope=request input=/WEB-INF/web/editfund.jsp validate=true forward name=success path=/editfund.do/ forward name=cancel path=/funds.do/ !-- I have also tried this forward name=cancel path=/fundlist.do/ -- /action action-mappings Then some explanation. I have fundlist action that displays all the funds, ok. Then when user selects one fund on the list struts executes editfund action and gets all needed information about that fund. Everything works correctly at this point. Then editfund.jsp has a form that has action mapped to updatefund action and also has an cancel button. If cancel button is pressed the updatefund action gets executed, am I right? Here is first two lines from UpdateAction class: if (isCancelled(request)) return (mapping.findForward(cancel)); Then it should go back to fundlist.do action, but all what I get is HTTP 400 Bad Request error. What I am doing wrong? Or should I do something different to get the same results? And I'm running struts on Apache Test Environment 3.2.1 for Visual Age 3.5.3. Thanks, Aapo Laakkonen -- Aapo Laakkonen, +358 (50) 33 99 682, ProjectCast Ltd, Helsinki, Finland.
Re: code reuse
From your description, it sounds like there could be an ancestor ActionForm common to the Order and Maintenance wizards. If that were the case, each could subclass that ActionForm, and the Corporate Info Action would then refer to the ancestor class, common to both wizards. In general, an Action does not need to be tightly coupled to a particular ActionForm. In fact, the coupling is rather loose. The Action itself is passed a reference to an ActionForm. Which ActionForm class is passed depends on the ActionMapping. There ~is~ a tight coupling between an ActionMapping and an ActionForm class, but the Actions themselves can be reused -- though some clever typecasting may be needed if more than one ActionForm class is accessed. It's important to remember that an Action can be used by any number of different ActionMappings. Whether or not they use the same ActionForm is up to the developer. The framework's design allows you to use a a different Action for each ActionForm, or a single Action for the entire application, or anything in between. (Praise be to Craig;-) -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ Stephen LeClair wrote: One of the minor Order screens is the Corporate Info screen (mainly address info)- it is designed to be a popup screen that can be called from within the Order wizard or the Account Maintenance wizard. However, it isn't implemented as an independent Action/Form because we don't know how to make the Order Form AND the Account Mntc Form both reuse the Corporate Info Form/Action. Specifically, we don't know how to implement such that the Action class for Corporate Info can be reused by both the Order and Account wizards. So, today the same fields are duplicated in the two wizards and all the code is duplicated (ugly!). We can envision a wrapper form that contains other forms and uses a dot notation in the JSPs to reference properties (orderForm.corporateInfoForm.address) but how do the Action classes for CorporateInfo get reused? There seems to be such tight coupling between an ActionForm and an Action Class that I don't know how to achieve reuse. I played with creating an IAddress Action interface that both the Order and Account wizards could implement but got caught up in the coupling issues.
Re: Baisc q 2 Cannot find message resources u/key -
The name of your web app is bbnpa? Then shouldn't your WEB-INF directory be located here? /bbnpa/WEB-INF Pete Chuck Amadi wrote: Hi i still get the following error message. My path is /bbnpa/helloworld/WEB-INF/classes/helloworld/HelloWorldResources.properties Any more pointers Cheers Chuck Error: 500 Location: /bbnpa/helloworld/hello.jsp Internal Servlet Error: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE Chuck Amadi wrote: Hi , can anyone work out this one i have followed the correct procedures albeit i am missing somthing. (bbnpa the name of my application) My path C:\jakarta-tomcat\webapps\bbnpa\helloworld\hello.jsp 1) declared directives. 2) created property file. 3) created web.xml file. 4)Copied all necessary .tld to /helloworld/WEB-INF/ 5)Copied all necessary .jar's to /WEB-INF/lib 6)Copied and deployed the struts-trailmap war's to /bbnpa/ my app's dir. Wats left error below Error: 500 Location: /bbnpa/helloworld/hello.jsp Internal Servlet Error: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE Cheers Chuck. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
Re: Mappings, bloody mappings
All the local forwards I see refer to funds.do -- but I do not see an ActionMapping for funds. There is a forward for funds, but that would not map to funds.do internally. The one you have marked as also tried looks all right though. I may be a typo, but your message mentioned an UpdateAction, but the type specified is FundUpdateAction. I'd also try running it under a development copy of Resin or Tomcat 4, which may give you more information with the error message. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ Aapo Laakkonen wrote: I have problem... It might be in my understanding, but here it goes... I have these mappings: form-beans form-bean name=FundUpdateForm type=com.projectcast.sfundm.FundForm/ /form-beans global-forwards forward name=funds path=/fundlist.do/ /global-forwards action-mappings action path=/fundlist type=com.projectcast.sfundm.FundListAction scope=request forward name=success path=/WEB-INF/web/fundlist.jsp/ forward name=failure path=/WEB-INF/web/fundlist.jsp/ /action action path=/editfund type=com.projectcast.sfundm.FundSelectAction scope=request forward name=success path=/WEB-INF/web/editfund.jsp/ forward name=failure path=/WEB-INF/web/editfund.jsp/ forward name=cancel path=/funds.do/ /action action path=/updatefund type=com.projectcast.sfundm.FundUpdateAction name=FundUpdateForm scope=request input=/WEB-INF/web/editfund.jsp validate=true forward name=success path=/editfund.do/ forward name=cancel path=/funds.do/ !-- I have also tried this forward name=cancel path=/fundlist.do/ -- /action action-mappings Then some explanation. I have fundlist action that displays all the funds, ok. Then when user selects one fund on the list struts executes editfund action and gets all needed information about that fund. Everything works correctly at this point. Then editfund.jsp has a form that has action mapped to updatefund action and also has an cancel button. If cancel button is pressed the updatefund action gets executed, am I right? Here is first two lines from UpdateAction class: if (isCancelled(request)) return (mapping.findForward(cancel)); Then it should go back to fundlist.do action, but all what I get is HTTP 400 Bad Request error. What I am doing wrong? Or should I do something different to get the same results? And I'm running struts on Apache Test Environment 3.2.1 for Visual Age 3.5.3. Thanks, Aapo Laakkonen -- Aapo Laakkonen, +358 (50) 33 99 682, ProjectCast Ltd, Helsinki, Finland.
Re: Problem Orion application server with STRUTS...
Yep this one happens to some deployments (not al!!) Just place the application properties file in the root of your classes directory, i.e. directly into web-inf/classes and reference it not in a sub-directory. I look forward to hearing if you come across the other problems we've hit. Sean -- Dr Sean Radford, MBBS, MSc Senior Consultant Agora Professional Services Ltd [EMAIL PROTECTED] http://www.agora.co.uk -- Agora Professional Services is an entrepreneurial consulting firm specialising in e-Business and innovative solutions since 1995. Jean-Francoi s Brassard To: [EMAIL PROTECTED] jfbrassard@occ: ricom.caSubject: Problem Orion application server with STRUTS... 23/07/2001 13:58 Please respond to struts-user Struts doesn't work with Orion for me, any people have a solution! Thank's in advance 01-07-22 22:24 strutsBlank: 1.0.2.2 Started 01-07-22 22:24 strutsBlank: Servlet error javax.servlet.jsp.JspException: Missing message for key index.title at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:242) at /index.jsp._jspService(/index.jsp.java:106) (JSP page line 8) at com.orionserver[Oracle9iAS (1.0.2.2) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:54) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.HttpApplication.serviceJSP(HttpApplication.java:5458) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.JSPServlet.service(JSPServlet.java:31) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:501) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:170) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:576) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:189) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:62) 01-07-22 22:25 defaultWebApp: 1.0.2.2 Stopped 01-07-22 22:25 strutsBlank: org.apache.struts.action.ActionServlet: Finalizing this controller servlet 01-07-22 22:25 strutsBlank: 1.0.2.2 Stopped
RE: Struts + Tomcat/Apache (again)
This is the same problem I am having I believe. I tried adding the JkMount lines, but when I restart Apache it gives me a Syntax error, with 'JkMount' as an invalid command. I am running Tomcat 3.2.2 with Apache 1.3.2 on Windows. Thanks Alex -Original Message- From: Steve Knight [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 9:43 AM To: [EMAIL PROTECTED]; Rakesh Subject: Re: Struts + Tomcat/Apache (again) I am having a very similar problem with Resin 1.2.7. I doesn't seem to be able to understand the *.do and I keep getting 404 Not Found pages. Is there anything I should be adding to my .conf file (like the JkMount/*.do ajp 13)? Thanks! Steve - Original Message - From: Rakesh [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 6:12 AM Subject: Re: Struts + Tomcat/Apache (again) its JkMount /*.do ajp13 remember the / this needs to be added as follows to your httpd conf. JkMount /*.jsp ajp13 JkMount /*.do ajp13 JkMount /servlet/* ajp13 Rakesh Ayilliath (Software Engineer) Synergy IT Innovations Pvt Ltd, #196, 1st Floor, 9th Cross, HMT Layout, RT Nagar Bangalore 560032 [EMAIL PROTECTED] www.ayilliath.8m.com - Original Message - From: Chuong Huynh [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 10:31 AM Subject: Struts + Tomcat/Apache (again) Hi all, There were some discussion about this matter but I can't find a workable answer. I still can't manage to make Strut work on Tomcat with Apache: the server can't understand .do extension (using Tomcat alone work fine). I've followed the doc carefully, and also followed the advise on the mailing list: add the line JkMount *.do ajp12 to the config file, and the problem is still the same: HTTP 404 - File not found Could anyone please help me. By the way, I used: Apache 1.3.17 Tomcat 3.2.2 Strut 1.0 Thanks, - Chuong = HUYNH, N. CHUONG TMA Software Solutions, Vietnam Tel: (84-8) 990 3848 - Ext: 5272 Email: [EMAIL PROTECTED] =
Logic:iterate primitive values
Howdy. I was wondering if any of the recent builds after Struts 1.0 (post-beta) handles logic:iterate directives with primitive data types. The documentation leads me to believe that this is a planned feature for a later release... Cheers, Melissa
Re: Baisc q 2 Cannot find message resources u/key -
i have discovered that this is an xml parser issue of some sort...i have this problem when running tomcat 4...the fix for that is to remove crimson and jaxp jars from the catalina/jasper directory and add xerces.jar to the catalina/lib directory... your solution may have to do with any other xml parsers in the classpath, or making sure that there is no duplication of any jars in your classpath...if xerces is duplicated, this error will probably also appear... just a thought... Jon Brisbin
Re: Struts + Tomcat/Apache (again)
I am attaching my httpd.conf file. Rakesh Ayilliath (Software Engineer) Synergy IT Innovations Pvt Ltd, #196, 1st Floor, 9th Cross, HMT Layout, RT Nagar Bangalore 560032 [EMAIL PROTECTED] www.ayilliath.8m.com - Original Message - From: Sorenson, Alexander [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 7:18 PM Subject: RE: Struts + Tomcat/Apache (again) This is the same problem I am having I believe. I tried adding the JkMount lines, but when I restart Apache it gives me a Syntax error, with 'JkMount' as an invalid command. I am running Tomcat 3.2.2 with Apache 1.3.2 on Windows. Thanks Alex -Original Message- From: Steve Knight [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 9:43 AM To: [EMAIL PROTECTED]; Rakesh Subject: Re: Struts + Tomcat/Apache (again) I am having a very similar problem with Resin 1.2.7. I doesn't seem to be able to understand the *.do and I keep getting 404 Not Found pages. Is there anything I should be adding to my .conf file (like the JkMount/*.do ajp 13)? Thanks! Steve - Original Message - From: Rakesh [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 6:12 AM Subject: Re: Struts + Tomcat/Apache (again) its JkMount /*.do ajp13 remember the / this needs to be added as follows to your httpd conf. JkMount /*.jsp ajp13 JkMount /*.do ajp13 JkMount /servlet/* ajp13 Rakesh Ayilliath (Software Engineer) Synergy IT Innovations Pvt Ltd, #196, 1st Floor, 9th Cross, HMT Layout, RT Nagar Bangalore 560032 [EMAIL PROTECTED] www.ayilliath.8m.com - Original Message - From: Chuong Huynh [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 10:31 AM Subject: Struts + Tomcat/Apache (again) Hi all, There were some discussion about this matter but I can't find a workable answer. I still can't manage to make Strut work on Tomcat with Apache: the server can't understand .do extension (using Tomcat alone work fine). I've followed the doc carefully, and also followed the advise on the mailing list: add the line JkMount *.do ajp12 to the config file, and the problem is still the same: HTTP 404 - File not found Could anyone please help me. By the way, I used: Apache 1.3.17 Tomcat 3.2.2 Strut 1.0 Thanks, - Chuong = HUYNH, N. CHUONG TMA Software Solutions, Vietnam Tel: (84-8) 990 3848 - Ext: 5272 Email: [EMAIL PROTECTED] = httpd.conf
Struts + JBoss
Hi. Has anyone of you managed to make Struts and JBoss working together? This is my current situation: I use JBoss-2.2.2 + Tomcat-3.2.2 (by run_with_tomcat.bat - so they are running in one VM) and Struts 1.0. The problem is briefly: When I deploy a .ear-archive that contains a .war-archive with the classes Struts should use (e.g. the form and action-classes), it throws an exception: javax.servlet.jsp.JspException: Exception creating bean of class path/DetailsForm: java.lang.ClassNotFoundException: path/DetailsForm at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:568) These are the lines of the Struts source-code where the exception is thrown: try { Class clazz = Class.forName(type); bean = clazz.newInstance(); if (bean instanceof ActionForm) ((ActionForm) bean).setServlet(servlet); } catch (Exception e) { throw new JspException (messages.getMessage(formTag.create, type, e.toString())); } The reason I blame Struts for that is the following: When I try to instanciate DetailsForm manually from the .jsp-page there is absolutely no problem. But Struts seems to use another classpath. Using the same .jsp-pages/classes/struts-config.xml/web.xml with Tomcat and J2EE-reference implementation works fine. - So I can say for sure that struts-config.xml and web.xml okay. This is the way the .ear-File looks like: .ear META-INF\ sun-j2ee-ri.xml, Manifest.mf, application.xml war-ic.war lots of stuff WEB-INF\ web.xml, struts-*.tld, struts-config.xml, global.properties classes\ Resources.properties all my classes ejb-jar-ic.jar the beans (they work fine) I once tried to add the .class-files manually to the classpath (not the ones that are created by jboss, when I deploy the .ear, but the .class-files, that I built before building the .ear-file). After that Struts was able to find the classes, but my classpath was completely messed up. The global.properties for example (which is accessible via InputStream is = getClass().getResourceAsStream(/global.properties) normally) was not found any more. Thanks in advance Dominic
Re: Mappings, bloody mappings
try this action-mappings action path=/fundlist type=com.projectcast.sfundm.FundListAction scope=request forward name=success path=/fundlist.jsp/ forward name=failure path=/fundlist.jsp/ /action I guess you do not require the /WEB-INF/web Rakesh Ayilliath (Software Engineer) Synergy IT Innovations Pvt Ltd, #196, 1st Floor, 9th Cross, HMT Layout, RT Nagar Bangalore 560032 [EMAIL PROTECTED] www.ayilliath.8m.com - Original Message - From: Aapo Laakkonen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 6:52 PM Subject: Mappings, bloody mappings I have problem... It might be in my understanding, but here it goes... I have these mappings: form-beans form-bean name=FundUpdateForm type=com.projectcast.sfundm.FundForm/ /form-beans global-forwards forward name=funds path=/fundlist.do/ /global-forwards action-mappings action path=/fundlist type=com.projectcast.sfundm.FundListAction scope=request forward name=success path=/WEB-INF/web/fundlist.jsp/ forward name=failure path=/WEB-INF/web/fundlist.jsp/ /action action path=/editfund type=com.projectcast.sfundm.FundSelectAction scope=request forward name=success path=/WEB-INF/web/editfund.jsp/ forward name=failure path=/WEB-INF/web/editfund.jsp/ forward name=cancel path=/funds.do/ /action action path=/updatefund type=com.projectcast.sfundm.FundUpdateAction name=FundUpdateForm scope=request input=/WEB-INF/web/editfund.jsp validate=true forward name=success path=/editfund.do/ forward name=cancel path=/funds.do/ !-- I have also tried this forward name=cancel path=/fundlist.do/ -- /action action-mappings Then some explanation. I have fundlist action that displays all the funds, ok. Then when user selects one fund on the list struts executes editfund action and gets all needed information about that fund. Everything works correctly at this point. Then editfund.jsp has a form that has action mapped to updatefund action and also has an cancel button. If cancel button is pressed the updatefund action gets executed, am I right? Here is first two lines from UpdateAction class: if (isCancelled(request)) return (mapping.findForward(cancel)); Then it should go back to fundlist.do action, but all what I get is HTTP 400 Bad Request error. What I am doing wrong? Or should I do something different to get the same results? And I'm running struts on Apache Test Environment 3.2.1 for Visual Age 3.5.3. Thanks, Aapo Laakkonen -- Aapo Laakkonen, +358 (50) 33 99 682, ProjectCast Ltd, Helsinki, Finland.
Re: Problem Orion application server with STRUTS...
Hi Sean, I use OC4J(is a version of orion application server), and i try this link: http://jakarta.apache.org/struts/installation-oas.html with i place the application properties in my root of my classes directory with a modification of my web.xml: init-param param-nameapplication/param-name param-valueApplicationResources/param-value /init-param I found again this error: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:568) at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239) at /index.jsp._jspService(/index.jsp.java:136) (JSP page line 8) at com.orionserver[Oracle9iAS (1.0.2.2) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:54) This is a problem with OC4J and Struts, a solution is possible, thank you very much in advance! - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 9:41 AM Subject: Re: Problem Orion application server with STRUTS... Yep this one happens to some deployments (not al!!) Just place the application properties file in the root of your classes directory, i.e. directly into web-inf/classes and reference it not in a sub-directory. I look forward to hearing if you come across the other problems we've hit. Sean -- Dr Sean Radford, MBBS, MSc Senior Consultant Agora Professional Services Ltd [EMAIL PROTECTED] http://www.agora.co.uk -- Agora Professional Services is an entrepreneurial consulting firm specialising in e-Business and innovative solutions since 1995. Jean-Francoi s Brassard To: [EMAIL PROTECTED] jfbrassard@occ: ricom.caSubject: Problem Orion application server with STRUTS... 23/07/2001 13:58 Please respond to struts-user Struts doesn't work with Orion for me, any people have a solution! Thank's in advance 01-07-22 22:24 strutsBlank: 1.0.2.2 Started 01-07-22 22:24 strutsBlank: Servlet error javax.servlet.jsp.JspException: Missing message for key index.title at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:242) at /index.jsp._jspService(/index.jsp.java:106) (JSP page line 8) at com.orionserver[Oracle9iAS (1.0.2.2) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:54) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.HttpApplication.serviceJSP(HttpApplication.java:5458) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.JSPServlet.service(JSPServlet.java:31) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.j ava:501) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDis patcher.java:170) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java: 576) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:189) at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:62) 01-07-22 22:25 defaultWebApp: 1.0.2.2 Stopped 01-07-22 22:25 strutsBlank: org.apache.struts.action.ActionServlet: Finalizing this controller servlet 01-07-22 22:25 strutsBlank: 1.0.2.2 Stopped
Re: Baisc q 2 Cannot find message resources u/key -
Hi, there only promlem is that i am not running tomcat 4. Cheers Chuck Jon Brisbin wrote: i have discovered that this is an xml parser issue of some sort...i have this problem when running tomcat 4...the fix for that is to remove crimson and jaxp jars from the catalina/jasper directory and add xerces.jar to the catalina/lib directory... your solution may have to do with any other xml parsers in the classpath, or making sure that there is no duplication of any jars in your classpath...if xerces is duplicated, this error will probably also appear... just a thought... Jon Brisbin -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
Re: Forwarding/redirecting to action mappings rather than directly to JSPs
Jim, did this solution involve using a global forward or just using something like the following: forward name=success path=/myList.do / Please post samples - thanks for your help! Matt --- Jim [EMAIL PROTECTED] wrote: Matt I got my code to work by removing the mapping from the request before forwarding from my action classes with the following line request.removeAttribute(Action.MAPPING_KEY); Prior to that it seemed that the previous mapping was not being overwritten by the ActionServlet. Hope this helps Jim - Original Message - From: Matt Raible To: [EMAIL PROTECTED] Sent: Friday, July 20, 2001 4:51 AM Subject: Forwarding/redirecting to action mappings rather than directly to JSPs Jim, Did you ever get this post figured out - I'm having a similar problem with iPlanet. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg11046.html Thanks, Matt __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
Initializing Application Scope Attributes *.do in template:put
Hi, perhaps these are FAQ: 1) My application has menu structure configurable in the database. I want to read the structure from the database when the app starts and store it in an application scoped bean. To be able to read the data, I need a DataSource so I need access to actionServlet. What is the best way to do this? I know, I can use my own servlet inherited form ActionServlet - but is there any ohter, perhaps more configurable way? 2) When I need initiazed data in my application, I usually put the initialization into setServlet of the action which needs the data and I thought never to need to access such data from a JSP directly. But now I've found this problem when creating menus. I've created a MenuForm which holds the information about the current location id and a collection of menu's children. MenuAction reads the id and fills the children collection, checking whether the current user should see the menu items. menu.jsp then displays the menu structure from MenuForm. It works perfectly, till I try to put this menu into another JSP via jsp:include ... or template:put content=/menu.do?id=100 The problem is that my MenuAction does not produce the HTML, it *forwards* it to the menu.jsp. And forwardning seems to be forbidden inside an include. (Err: Cannot forward as OutputStream or Writer has already been obtained) Is there a way, how to include a *.do generated page which internally uses forward? (Actually, this could be probable solved with the workflows. The action actually does not have to forward to the jsp. I just need to let it perform and include the jsp then) -- gR
Re: Struts + JBoss
i've had trouble with jboss 2.2.2/tomcat 3.2.2...for this reason i dropped back to the 2.2.1/3.2.1 version and everything worked fine... in my experimentation, it seems to be a classloader issue...any classes you want to access from another class must be either on the same level, or higher in your classpath...if a .jar file that is located in the jboss/lib/ext directory is accessing a struts class or action class that is in your WEB-INF/lib/this.jar file, then it will give you this message... it's been a real pain :-) Jon Brisbin Lamar, MO - Original Message - From: ecn11 [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 9:46 AM Subject: Struts + JBoss Hi. Has anyone of you managed to make Struts and JBoss working together? This is my current situation: I use JBoss-2.2.2 + Tomcat-3.2.2 (by run_with_tomcat.bat - so they are running in one VM) and Struts 1.0. The problem is briefly: When I deploy a .ear-archive that contains a .war-archive with the classes Struts should use (e.g. the form and action-classes), it throws an exception: javax.servlet.jsp.JspException: Exception creating bean of class path/DetailsForm: java.lang.ClassNotFoundException: path/DetailsForm at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:568) These are the lines of the Struts source-code where the exception is thrown: try { Class clazz = Class.forName(type); bean = clazz.newInstance(); if (bean instanceof ActionForm) ((ActionForm) bean).setServlet(servlet); } catch (Exception e) { throw new JspException (messages.getMessage(formTag.create, type, e.toString())); } The reason I blame Struts for that is the following: When I try to instanciate DetailsForm manually from the .jsp-page there is absolutely no problem. But Struts seems to use another classpath. Using the same .jsp-pages/classes/struts-config.xml/web.xml with Tomcat and J2EE-reference implementation works fine. - So I can say for sure that struts-config.xml and web.xml okay. This is the way the .ear-File looks like: .ear META-INF\ sun-j2ee-ri.xml, Manifest.mf, application.xml war-ic.war lots of stuff WEB-INF\ web.xml, struts-*.tld, struts-config.xml, global.properties classes\ Resources.properties all my classes ejb-jar-ic.jar the beans (they work fine) I once tried to add the .class-files manually to the classpath (not the ones that are created by jboss, when I deploy the .ear, but the .class-files, that I built before building the .ear-file). After that Struts was able to find the classes, but my classpath was completely messed up. The global.properties for example (which is accessible via InputStream is = getClass().getResourceAsStream(/global.properties) normally) was not found any more. Thanks in advance Dominic
Re: Another question about the logic:iterate tag
The docs say JSP bean, but the meaning there is broad. So, yes, you can do this: request.setAttribute(hashmap,hashmap); ... logic:iterate name=hashmap To use an actual bean, you would also specify the property logic:iterate name=javaBean property=hashmap which resolves to javaBean.getHashmap() Melissa wrote: Hi again. I am wondering whether the logic:iterate tag requires you to use a bean (or bean property) as the collection to iterate over. I would actually like to iterate over a hashmap that i placed in the request in my action class, but I have not determined through the user docs whether this is possible or not. Any help would be greatly appreciated! Melissa -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/
Re: Mappings, bloody mappings
I am sorry I guess U need to keep the '/web' intact. try this action-mappings action path=/fundlist type=com.projectcast.sfundm.FundListAction scope=request forward name=success path=/web/fundlist.jsp/ forward name=failure path=/web/fundlist.jsp/ /action Rakesh Ayilliath (Software Engineer) Synergy IT Innovations Pvt Ltd, #196, 1st Floor, 9th Cross, HMT Layout, RT Nagar Bangalore 560032 [EMAIL PROTECTED] www.ayilliath.8m.com - Original Message - From: Aapo Laakkonen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 6:52 PM Subject: Mappings, bloody mappings I have problem... It might be in my understanding, but here it goes... I have these mappings: form-beans form-bean name=FundUpdateForm type=com.projectcast.sfundm.FundForm/ /form-beans global-forwards forward name=funds path=/fundlist.do/ /global-forwards action-mappings action path=/fundlist type=com.projectcast.sfundm.FundListAction scope=request forward name=success path=/WEB-INF/web/fundlist.jsp/ forward name=failure path=/WEB-INF/web/fundlist.jsp/ /action action path=/editfund type=com.projectcast.sfundm.FundSelectAction scope=request forward name=success path=/WEB-INF/web/editfund.jsp/ forward name=failure path=/WEB-INF/web/editfund.jsp/ forward name=cancel path=/funds.do/ /action action path=/updatefund type=com.projectcast.sfundm.FundUpdateAction name=FundUpdateForm scope=request input=/WEB-INF/web/editfund.jsp validate=true forward name=success path=/editfund.do/ forward name=cancel path=/funds.do/ !-- I have also tried this forward name=cancel path=/fundlist.do/ -- /action action-mappings Then some explanation. I have fundlist action that displays all the funds, ok. Then when user selects one fund on the list struts executes editfund action and gets all needed information about that fund. Everything works correctly at this point. Then editfund.jsp has a form that has action mapped to updatefund action and also has an cancel button. If cancel button is pressed the updatefund action gets executed, am I right? Here is first two lines from UpdateAction class: if (isCancelled(request)) return (mapping.findForward(cancel)); Then it should go back to fundlist.do action, but all what I get is HTTP 400 Bad Request error. What I am doing wrong? Or should I do something different to get the same results? And I'm running struts on Apache Test Environment 3.2.1 for Visual Age 3.5.3. Thanks, Aapo Laakkonen -- Aapo Laakkonen, +358 (50) 33 99 682, ProjectCast Ltd, Helsinki, Finland.
Re: Baisc q 2 Cannot find message resources u/key -
My path is as follows bbbnpa/helloworld/WEB-INF/classes/helloworld/HelloWorldResources.properties. bbnpa is my web app.I assumed that the helloworld example being my base dir was under the web app. Thus i have got another main WEB-INF/ that contains the similar tld's jar's in the correct location. is that ok. or must i have only one WEB-INF/ as i believed this is where i might have gone wrong by not having the base dir's with separate WEB-INF/ . ie /base dir /WEB-INF/classes/ .etc .etc Cheers Chuck Peter Alfors wrote: The name of your web app is bbnpa? Then shouldn't your WEB-INF directory be located here? /bbnpa/WEB-INF Pete Chuck Amadi wrote: Hi i still get the following error message. My path is /bbnpa/helloworld/WEB-INF/classes/helloworld/HelloWorldResources.properties Any more pointers Cheers Chuck Error: 500 Location: /bbnpa/helloworld/hello.jsp Internal Servlet Error: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE Chuck Amadi wrote: Hi , can anyone work out this one i have followed the correct procedures albeit i am missing somthing. (bbnpa the name of my application) My path C:\jakarta-tomcat\webapps\bbnpa\helloworld\hello.jsp 1) declared directives. 2) created property file. 3) created web.xml file. 4)Copied all necessary .tld to /helloworld/WEB-INF/ 5)Copied all necessary .jar's to /WEB-INF/lib 6)Copied and deployed the struts-trailmap war's to /bbnpa/ my app's dir. Wats left error below Error: 500 Location: /bbnpa/helloworld/hello.jsp Internal Servlet Error: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE Cheers Chuck. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
Re: Baisc q 2 Cannot find message resources u/key -
Hi, there only promlem is that i am not running tomcat 4. i know that... :-) ok...let's try this worded a different way: the problem is an xml parser issue, as this question has come up a lot lately and i got my own servlet container to work by carefully analyzing where and when my xml parsers were getting loaded... your solution will *obviously* be different, but the problem seems to come from classloading of xml parsers...you'll of course need to look through your lib directories and make sure no other jaxp or crimson parsers are there, replacing them with xerces 1.3.1 (1.4.1 will also give some issues with some containers, specifically tomcat)... i was only using my solution as an *example* of how everyone having this problem can analyze their own servlet container to help fix the problem. i was getting pretty irritated because NO ONE was helping me fix this problem, or even offering constructive advice on the deeper issue i knew it had to be...one deeper than just making sure my config files were accurate... it's something worth trying, anyway... jb
Re: Struts + JBoss
Hi. Has anyone of you managed to make Struts and JBoss working together? This is my current situation: I use JBoss-2.2.2 + Tomcat-3.2.2 (by run_with_tomcat.bat - so they are running in one VM) and Struts 1.0. Hi, I use struts in jboss+tomcat. I use 2 configurations: 1st) Separate ejb and war. There are no problems, since I have no EAR file. 2nd) An EAR file. This is a bit tricky: a) you have to let struts.jar in the root of the EAR. Do not place it under war/WEB-INF/lib. Do the same with all jars which would go into WEB-INF/lib b) in war's META-INF/manifest.mf you need following lines for needed libraries: Class-Path: ./struts.jar Class-Path: ./somethingelse.jar So far so good. ActionServlet will be found, your Actions as well But I've had problems with Jasper. It was not able to compile my JSP pages, since it was not loading the jars from manifest.mf The solution was to use jasper at deployment time and let it to compile all jsp pages into java, compile those java sources into classes, jar them and put the jsp.jar into my EAR along with the modified web.xml Even with ant it is not so easy and the deployment takes a lot of time. So I use the 1st approach during development. -- gR
Re: Baisc q 2 Cannot find message resources u/key -
Jon, That did something. Before when I was starting my server, the console read: - Starting service Tomcat-Standalone Apache Tomcat/4.0-b6 Starting service Tomcat-Apache Apache Tomcat/4.0-b6 -- Now the console shows: -- A nonfatal internal JIT (3.10.107(x)) error 'Relocation error: NULL relocation target' has occurred in : 'org/apache/crimson/parser/Parser2.maybeComment (Z)Z': Interpreting method. Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cgi Starting service Tomcat-Standalone Apache Tomcat/4.0-b6 register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar:file:/C:/Tomcat/bin/../webapps/struts-example/WEB-INF/lib/struts.jar!/org/apache/struts/resources/struts-config_1_0.dtd' register('-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN', 'jar:file:/C:/Tomcat/bin/../webapps/struts-example/WEB-INF/lib/struts.jar!/org/apache/struts/ resources/web-app_2_2.dtd' register('-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN', 'jar:file:/C: /Tomcat/bin/../webapps/struts-example/WEB-INF/lib/struts.jar!/org/apache/struts/ resources/web-app_2_3.dtd' register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar :file:/C:/Tomcat/bin/../webapps/struts-blank/WEB-INF/lib/struts.jar!/org/apache/ struts/resources/struts-config_1_0.dtd' register('-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN', 'jar:file:/C: /Tomcat/bin/../webapps/struts-blank/WEB-INF/lib/struts.jar!/org/apache/struts/re sources/web-app_2_2.dtd' register('-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN', 'jar:file:/C: /Tomcat/bin/../webapps/struts-blank/WEB-INF/lib/struts.jar!/org/apache/struts/re sources/web-app_2_3.dtd' Starting service Tomcat-Apache Apache Tomcat/4.0-b6 -- When the index.jsp page for the struts-example application attempts to load, it seems to get caught in a loop.. Still no joy, but at least something different is happening. Thanks, Brian Jon Brisbin brisbin@ipa.To: [EMAIL PROTECTED] net cc: Chuck Amadi [EMAIL PROTECTED] Subject: Re: Baisc q 2 Cannot find message resources u/key - 07/24/2001 10:02 AM Please respond to struts-user Hi, there only promlem is that i am not running tomcat 4. i know that... :-) ok...let's try this worded a different way: the problem is an xml parser issue, as this question has come up a lot lately and i got my own servlet container to work by carefully analyzing where and when my xml parsers were getting loaded... your solution will *obviously* be different, but the problem seems to come from classloading of xml parsers...you'll of course need to look through your lib directories and make sure no other jaxp or crimson parsers are there, replacing them with xerces 1.3.1 (1.4.1 will also give some issues with some containers, specifically tomcat)... i was only using my solution as an *example* of how everyone having this problem can analyze their own servlet container to help fix the problem. i was getting pretty irritated because NO ONE was helping me fix this problem, or even offering constructive advice on the deeper issue i knew it had to be...one deeper than just making sure my config files were accurate... it's something worth trying, anyway... jb
Re: Baisc q 2 Cannot find message resources u/key -
Hi, Ted i have been using the following path. C:\jakarta-tomcat-3.2.2\webapps\bbnpa\META-INF \WEB-INF\classes /// dont work thus temp shifted them. \css///all work cascade style sheets dir \graphics ///all work graphics \helloworld\WEB-INF\classes\helloworld\HelloWorldProperties. \templates \index.jsp \other jsp //all work All the other Work Web-Site html including Javscript pages migrated to jsp work fine . Except my classes under the first WEB-INF\ Thus Invalid Package Declarations . Oh Oh Cheers Chuck Jon Brisbin wrote: i have discovered that this is an xml parser issue of some sort...i have this problem when running tomcat 4...the fix for that is to remove crimson and jaxp jars from the catalina/jasper directory and add xerces.jar to the catalina/lib directory... your solution may have to do with any other xml parsers in the classpath, or making sure that there is no duplication of any jars in your classpath...if xerces is duplicated, this error will probably also appear... just a thought... Jon Brisbin -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
HIT PAY DIRT! Re: Baisc q 2 Cannot find message resources u/key -
Jon, When you posted the version of the xerces compiler you were using ***xerces 1.3.1***, that solved my problem. Here's the link guys: http://xml.apache.org/dist/xerces-j/ Get xerces1.3.1.zip from the link above and do like Jon said in his original message. Remove the other XML parsers from your classpath (I had JAXP mucking things up), then get xerces.jar out of the zip file that you download, and place it in the Tomcat/lib directory. Make sure to update catalina.bat in Tomcat/bin to setup your runtime classpath. Mine looks like: set CP=%CATALINA_HOME%\bin\bootstrap.jar;c: \tomcat\lib\xerces.jar;%JAVA_HOME%\lib\tools.jar;c: \tomcat\webapps\struts-example\WEB-INF;c: \tomcat\webapps\struts-example\WEB-INF\lib\struts.jar Thanks! Brian p.s. Woohoo!!! Jon Brisbin brisbin@ipa.To: [EMAIL PROTECTED] net cc: Chuck Amadi [EMAIL PROTECTED] Subject: Re: Baisc q 2 Cannot find message resources u/key - 07/24/2001 10:02 AM Please respond to struts-user Hi, there only promlem is that i am not running tomcat 4. i know that... :-) ok...let's try this worded a different way: the problem is an xml parser issue, as this question has come up a lot lately and i got my own servlet container to work by carefully analyzing where and when my xml parsers were getting loaded... your solution will *obviously* be different, but the problem seems to come from classloading of xml parsers...you'll of course need to look through your lib directories and make sure no other jaxp or crimson parsers are there, replacing them with xerces 1.3.1 (1.4.1 will also give some issues with some containers, specifically tomcat)... i was only using my solution as an *example* of how everyone having this problem can analyze their own servlet container to help fix the problem. i was getting pretty irritated because NO ONE was helping me fix this problem, or even offering constructive advice on the deeper issue i knew it had to be...one deeper than just making sure my config files were accurate... it's something worth trying, anyway... jb
Re: Baisc q 2 Cannot find message resources u/key -
it looks like you need to remove crimson.jar from your classpath still...maybe it's in the system classpath before you start tomcat?? struts does not like anything but xerces 1.3.1, for some reason, in the newer containers... jb - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 10:26 AM Subject: Re: Baisc q 2 Cannot find message resources u/key - Jon, That did something. Before when I was starting my server, the console read: - Starting service Tomcat-Standalone Apache Tomcat/4.0-b6 Starting service Tomcat-Apache Apache Tomcat/4.0-b6 -- Now the console shows: -- A nonfatal internal JIT (3.10.107(x)) error 'Relocation error: NULL relocation target' has occurred in : 'org/apache/crimson/parser/Parser2.maybeComment (Z)Z': Interpreting method. Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cgi Starting service Tomcat-Standalone Apache Tomcat/4.0-b6 register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar:file:/C:/Tomcat/bin/../webapps/struts-example/WEB-INF/lib/struts.jar!/o rg/apache/struts/resources/struts-config_1_0.dtd' register('-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN', 'jar:file:/C:/Tomcat/bin/../webapps/struts-example/WEB-INF/lib/struts.jar!/o rg/apache/struts/ resources/web-app_2_2.dtd' register('-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN', 'jar:file:/C: /Tomcat/bin/../webapps/struts-example/WEB-INF/lib/struts.jar!/org/apache/str uts/ resources/web-app_2_3.dtd' register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar :file:/C:/Tomcat/bin/../webapps/struts-blank/WEB-INF/lib/struts.jar!/org/apa che/ struts/resources/struts-config_1_0.dtd' register('-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN', 'jar:file:/C: /Tomcat/bin/../webapps/struts-blank/WEB-INF/lib/struts.jar!/org/apache/strut s/re sources/web-app_2_2.dtd' register('-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN', 'jar:file:/C: /Tomcat/bin/../webapps/struts-blank/WEB-INF/lib/struts.jar!/org/apache/strut s/re sources/web-app_2_3.dtd' Starting service Tomcat-Apache Apache Tomcat/4.0-b6 -- When the index.jsp page for the struts-example application attempts to load, it seems to get caught in a loop.. Still no joy, but at least something different is happening. Thanks, Brian Jon Brisbin brisbin@ipa.To: [EMAIL PROTECTED] net cc: Chuck Amadi [EMAIL PROTECTED] Subject: Re: Baisc q 2 Cannot find message resources u/key - 07/24/2001 10:02 AM Please respond to struts-user Hi, there only promlem is that i am not running tomcat 4. i know that... :-) ok...let's try this worded a different way: the problem is an xml parser issue, as this question has come up a lot lately and i got my own servlet container to work by carefully analyzing where and when my xml parsers were getting loaded... your solution will *obviously* be different, but the problem seems to come from classloading of xml parsers...you'll of course need to look through your lib directories and make sure no other jaxp or crimson parsers are there, replacing them with xerces 1.3.1 (1.4.1 will also give some issues with some containers, specifically tomcat)... i was only using my solution as an *example* of how everyone having this problem can analyze their own servlet container to help fix the problem. i was getting pretty irritated because NO ONE was helping me fix this problem, or even offering constructive advice on the deeper issue i knew it had to be...one deeper than just making sure my config files were accurate... it's something worth trying, anyway... jb
RE: Another question about the logic:iterate tag
I have just tried this, but the id attribute is apparently required. My guess is that this can just be an arbitrary variable... However, the bigger issue seems to be that the iterate tag isn't really suited to the retrieval of more than one oject (i.e. the hashmap's key/value pairs)... here's the old code I was hoping to convert: !--% HashMap jmap = (HashMap)request.getAttribute(hmap); for (Iterator i = jmap.keySet().iterator(); i.hasNext(); ) { String key = (String)i.next(); Object obj = jmap.get(key); % tr tdfont size=1%= key %/font/td tdfont size=1%= obj.toString()%/font/td /tr-- % } % Is there a way to integrate this into a Struts iterate tag, or should i just stick with the original code? Thanks so much for your help. Melissa (Strutting better every day) -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 11:03 AM To: [EMAIL PROTECTED] Subject: Re: Another question about the logic:iterate tag The docs say JSP bean, but the meaning there is broad. So, yes, you can do this: request.setAttribute(hashmap,hashmap); ... logic:iterate name=hashmap To use an actual bean, you would also specify the property logic:iterate name=javaBean property=hashmap which resolves to javaBean.getHashmap() Melissa wrote: Hi again. I am wondering whether the logic:iterate tag requires you to use a bean (or bean property) as the collection to iterate over. I would actually like to iterate over a hashmap that i placed in the request in my action class, but I have not determined through the user docs whether this is possible or not. Any help would be greatly appreciated! Melissa -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/
RE: what setters do i implement in an indexed tag ?
In the indexed tags write up at http://www.husted.com/about/struts/indexed-tags.htm, it only mentions the two types of get methods required in the action form. It doesn't mention the setters that are required. It looks like the getParameterList() method is only used by the iterate tag. To populate the form on submit the only setter needed is: public void setParameter(int index, Parameter p){...}; In your case that means: public void setParameter(int index, FieldMapping f) {...}; You probably don't need: public void setFieldMappings(java.util.Vector newFieldMappings) { fieldMappings = newFieldMappings; } unless you use it in your action to populate the form object before displaying the form jsp. I am about to try this myself so this is just a guess. Hal -Original Message- From: Warwick Boote [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 9:09 AM To: [EMAIL PROTECTED] Subject: what setters do i implement in an indexed tag ? I've created a page using indexed tags (neat stuff!). Here is what is currently working for me: o If i populate the form's vector, values from that vector are displayed in the jsp Here is what it not working: o when the form is posted back, the vector is null (in the struts perform() method) I suspect i haven't implemented some sort of setter within the form but i can't find an example as to what method should be implemented. I've tried ArrayList and using parameterList instead with no different result. Thanks, Waz. =) Here are some code snippits for help: ---jsp--- logic:iterate id=mappings name=FieldsMapForm property=fieldMappings html:text name=mappings property=attributeCode indexed=true/ br /logic:iterate ---Form--- public class FieldsMapForm extends ActionForm { private String fileColCount; private java.util.Vector fieldMappings = new java.util.Vector(); private String action; public String getFileColCount() { return fileColCount; } public void setFileColCount(String newFileColCount) { fileColCount = newFileColCount; } public void setFieldMappings(java.util.Vector newFieldMappings) { fieldMappings = newFieldMappings; } public java.util.Vector getFieldMappings() { return fieldMappings; } public FieldMapping getParameter(int index) { return (FieldMapping)fieldMappings.elementAt(index); } public void setAction(String newAction) { action = newAction; } public String getAction() { return action; } public void reset(ActionMapping mapping, HttpServletRequest request) { fileColCount = null; fieldMappings = new java.util.Vector(); action = null; } } ---The vector contains these:--- public class FieldMapping implements Serializable { private Integer fieldNumber; private String attributeCode; public void setFieldNumber(Integer newFieldNumber) { fieldNumber = newFieldNumber; } public Integer getFieldNumber() { return fieldNumber; } public void setAttributeCode(String newAttributeCode) { attributeCode = newAttributeCode; } public String getAttributeCode() { return attributeCode; } }
html:form scripting variable
Hi, why does html:form generate no scripting variable? Would be nice, if it did. -- gR
RE: what setters do i implement in an indexed tag ?
Ignore my previous post because I was mistaken. You don't need a setXYZ(int index, XYZ x) method because struts will call the public XYZ getXYZ(index i) method and then call the appropriate set method on the bean that is returned. This worked for me (with last nights CVS): logic:iterate id=interestRate name=editInterestForm property=interestRates tr tdhtml:hidden indexed=true name=interestRate property=interestRateId/ html:text indexed=true name=interestRate property=monthId/ /td tdhtml:text indexed=true name=interestRate property=rate size=5 maxlength=5/ /td /tr /logic:iterate which generates field names like interestRate[0].monthId so struts will call form.getInterestRate(0).setMonthId(somevalue) I had this in my form class: ArrayList interestRates; // initialized in constructor and reset() public InterestRateJBean getInterestRate(int index) { if (index interestRates.size()-1) { interestRates.add(index,new InterestRateJBean()); } return (InterestRateJBean) interestRates.get(index); } Again, I just got this to work so I may be missing something. Hal -Original Message- From: Deadman, Hal Sent: Tuesday, July 24, 2001 11:03 AM To: [EMAIL PROTECTED] Subject: RE: what setters do i implement in an indexed tag ? In the indexed tags write up at http://www.husted.com/about/struts/indexed-tags.htm, it only mentions the two types of get methods required in the action form. It doesn't mention the setters that are required. It looks like the getParameterList() method is only used by the iterate tag. To populate the form on submit the only setter needed is: public void setParameter(int index, Parameter p){...}; In your case that means: public void setParameter(int index, FieldMapping f) {...}; You probably don't need: public void setFieldMappings(java.util.Vector newFieldMappings) { fieldMappings = newFieldMappings; } unless you use it in your action to populate the form object before displaying the form jsp. I am about to try this myself so this is just a guess. Hal -Original Message- From: Warwick Boote [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 9:09 AM To: [EMAIL PROTECTED] Subject: what setters do i implement in an indexed tag ? I've created a page using indexed tags (neat stuff!). Here is what is currently working for me: o If i populate the form's vector, values from that vector are displayed in the jsp Here is what it not working: o when the form is posted back, the vector is null (in the struts perform() method) I suspect i haven't implemented some sort of setter within the form but i can't find an example as to what method should be implemented. I've tried ArrayList and using parameterList instead with no different result. Thanks, Waz. =) Here are some code snippits for help: ---jsp--- logic:iterate id=mappings name=FieldsMapForm property=fieldMappings html:text name=mappings property=attributeCode indexed=true/ br /logic:iterate ---Form--- public class FieldsMapForm extends ActionForm { private String fileColCount; private java.util.Vector fieldMappings = new java.util.Vector(); private String action; public String getFileColCount() { return fileColCount; } public void setFileColCount(String newFileColCount) { fileColCount = newFileColCount; } public void setFieldMappings(java.util.Vector newFieldMappings) { fieldMappings = newFieldMappings; } public java.util.Vector getFieldMappings() { return fieldMappings; } public FieldMapping getParameter(int index) { return (FieldMapping)fieldMappings.elementAt(index); } public void setAction(String newAction) { action = newAction; } public String getAction() { return action; } public void reset(ActionMapping mapping, HttpServletRequest request) { fileColCount = null; fieldMappings = new java.util.Vector(); action = null; } } ---The vector contains these:--- public class FieldMapping implements Serializable { private Integer fieldNumber; private String attributeCode; public void setFieldNumber(Integer newFieldNumber) { fieldNumber = newFieldNumber; } public Integer getFieldNumber() { return fieldNumber; } public void setAttributeCode(String newAttributeCode) { attributeCode = newAttributeCode; } public String getAttributeCode() { return attributeCode; } }
Re: code reuse
In my first attempt, I think that I got caught up in the clever typecasting may be needed if more than one ActionForm class is accessed problem. I'm trying to design a template for a few generic reusable Action classes ( Corporate Info, Contact Info, Location Info ). I'll work up a simple prototype to identify what I'm missing. Thanks...Steve - Original Message - From: Ted Husted [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 9:25 AM Subject: Re: code reuse From your description, it sounds like there could be an ancestor ActionForm common to the Order and Maintenance wizards. If that were the case, each could subclass that ActionForm, and the Corporate Info Action would then refer to the ancestor class, common to both wizards. In general, an Action does not need to be tightly coupled to a particular ActionForm. In fact, the coupling is rather loose. The Action itself is passed a reference to an ActionForm. Which ActionForm class is passed depends on the ActionMapping. There ~is~ a tight coupling between an ActionMapping and an ActionForm class, but the Actions themselves can be reused -- though some clever typecasting may be needed if more than one ActionForm class is accessed. It's important to remember that an Action can be used by any number of different ActionMappings. Whether or not they use the same ActionForm is up to the developer. The framework's design allows you to use a a different Action for each ActionForm, or a single Action for the entire application, or anything in between. (Praise be to Craig;-) -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ Stephen LeClair wrote: One of the minor Order screens is the Corporate Info screen (mainly address info)- it is designed to be a popup screen that can be called from within the Order wizard or the Account Maintenance wizard. However, it isn't implemented as an independent Action/Form because we don't know how to make the Order Form AND the Account Mntc Form both reuse the Corporate Info Form/Action. Specifically, we don't know how to implement such that the Action class for Corporate Info can be reused by both the Order and Account wizards. So, today the same fields are duplicated in the two wizards and all the code is duplicated (ugly!). We can envision a wrapper form that contains other forms and uses a dot notation in the JSPs to reference properties (orderForm.corporateInfoForm.address) but how do the Action classes for CorporateInfo get reused? There seems to be such tight coupling between an ActionForm and an Action Class that I don't know how to achieve reuse. I played with creating an IAddress Action interface that both the Order and Account wizards could implement but got caught up in the coupling issues.
RE: what setters do i implement in an indexed tag ?
Hi, You need 3 methods, a getter and a setter for the Vector (or other arraytype object) and a getter for single object in your arraytype object, i.e., getObject(int inx){ return myVector.elementAt(inx) } Just like on the webpage mentioned. the setters needed should be defined on the object your are returning in the getObject method. That is, what happens when the form fild data is passed to the form object is: getObject(inx).setProperty(someProperty). Dave Hay posted a very usefull example (source) in a post with subject: Re: Long Story short, posted on 2001.07.19!! You should check that out! ^terp -Original Message- From: Deadman, Hal [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 5:03 PM To: [EMAIL PROTECTED] Subject: RE: what setters do i implement in an indexed tag ? In the indexed tags write up at http://www.husted.com/about/struts/indexed-tags.htm, it only mentions the two types of get methods required in the action form. It doesn't mention the setters that are required. It looks like the getParameterList() method is only used by the iterate tag. To populate the form on submit the only setter needed is: public void setParameter(int index, Parameter p){...}; In your case that means: public void setParameter(int index, FieldMapping f) {...}; You probably don't need: public void setFieldMappings(java.util.Vector newFieldMappings) { fieldMappings = newFieldMappings; } unless you use it in your action to populate the form object before displaying the form jsp. I am about to try this myself so this is just a guess. Hal -Original Message- From: Warwick Boote [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 9:09 AM To: [EMAIL PROTECTED] Subject: what setters do i implement in an indexed tag ? I've created a page using indexed tags (neat stuff!). Here is what is currently working for me: o If i populate the form's vector, values from that vector are displayed in the jsp Here is what it not working: o when the form is posted back, the vector is null (in the struts perform() method) I suspect i haven't implemented some sort of setter within the form but i can't find an example as to what method should be implemented. I've tried ArrayList and using parameterList instead with no different result. Thanks, Waz. =) Here are some code snippits for help: ---jsp--- logic:iterate id=mappings name=FieldsMapForm property=fieldMappings html:text name=mappings property=attributeCode indexed=true/ br /logic:iterate ---Form--- public class FieldsMapForm extends ActionForm { private String fileColCount; private java.util.Vector fieldMappings = new java.util.Vector(); private String action; public String getFileColCount() { return fileColCount; } public void setFileColCount(String newFileColCount) { fileColCount = newFileColCount; } public void setFieldMappings(java.util.Vector newFieldMappings) { fieldMappings = newFieldMappings; } public java.util.Vector getFieldMappings() { return fieldMappings; } public FieldMapping getParameter(int index) { return (FieldMapping)fieldMappings.elementAt(index); } public void setAction(String newAction) { action = newAction; } public String getAction() { return action; } public void reset(ActionMapping mapping, HttpServletRequest request) { fileColCount = null; fieldMappings = new java.util.Vector(); action = null; } } ---The vector contains these:--- public class FieldMapping implements Serializable { private Integer fieldNumber; private String attributeCode; public void setFieldNumber(Integer newFieldNumber) { fieldNumber = newFieldNumber; } public Integer getFieldNumber() { return fieldNumber; } public void setAttributeCode(String newAttributeCode) { attributeCode = newAttributeCode; } public String getAttributeCode() { return attributeCode; } }
loader constraints violated when loading mapping file
when i go to load my own struts app in tomcat 4, i get the following error when ANY servlet in that webapp tries to start...it has to do with the whole xerces/struts/tomcat4 issue, but i'm not sure why the servlet won't load for this app, but it will for the struts example app...same message when loading servlet jsp too... java.lang.LinkageError: loader constraints violated when linking org/xml/sax/HandlerBase class at org.apache.struts.digester.Digester.parse(Digester.java:755) at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1331) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:465) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:857) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:602) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:214) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:219) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2251) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java: 984) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1074 ) at java.lang.Thread.run(Thread.java:484)
Re: html:form scripting variable
It does set a page scoped attribute (keyed by the form name from the mapping) that contains the form object. Erik - Original Message - From: Gregor Rayman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 9:50 AM Subject: html:form scripting variable Hi, why does html:form generate no scripting variable? Would be nice, if it did. -- gR
Re: Another question about the logic:iterate tag
id is the name you want to give each item in the map as it iterates. For more see, http://jakarta.apache.org/struts/struts-logic.html#iterate We are about to add more indexing support, which may help you further. See the Indexed Tablibs item at http://husted.com/about/struts/resources.htm#taglibs for an early release. Melissa wrote: I have just tried this, but the id attribute is apparently required. My guess is that this can just be an arbitrary variable... However, the bigger issue seems to be that the iterate tag isn't really suited to the retrieval of more than one oject (i.e. the hashmap's key/value pairs)... here's the old code I was hoping to convert: !--% HashMap jmap = (HashMap)request.getAttribute(hmap); for (Iterator i = jmap.keySet().iterator(); i.hasNext(); ) { String key = (String)i.next(); Object obj = jmap.get(key); % tr tdfont size=1%= key %/font/td tdfont size=1%= obj.toString()%/font/td /tr-- % } % Is there a way to integrate this into a Struts iterate tag, or should i just stick with the original code? Thanks so much for your help. Melissa (Strutting better every day) -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 11:03 AM To: [EMAIL PROTECTED] Subject: Re: Another question about the logic:iterate tag The docs say JSP bean, but the meaning there is broad. So, yes, you can do this: request.setAttribute(hashmap,hashmap); ... logic:iterate name=hashmap To use an actual bean, you would also specify the property logic:iterate name=javaBean property=hashmap which resolves to javaBean.getHashmap() Melissa wrote: Hi again. I am wondering whether the logic:iterate tag requires you to use a bean (or bean property) as the collection to iterate over. I would actually like to iterate over a hashmap that i placed in the request in my action class, but I have not determined through the user docs whether this is possible or not. Any help would be greatly appreciated! Melissa -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/
Re: servlet error with struts 1.0 (release) and tomcat 4
Jon, I received that same error after I removed catalina.jar, but didn't have xerces.jar in the classpath. Brian Jon Brisbin brisbin@ipa.To: Struts List [EMAIL PROTECTED] net cc: Subject: servlet error with struts 1.0 (release) and tomcat 4 07/24/2001 11:40 AM Please respond to struts-user i get the following with some (but not all) struts 1.0 webapps in tomcat 4...any help would be appreciated: jb A Servlet Exception Has Occurred Exception Report: javax.servlet.ServletException: Servlet.init() for servlet jsp threw exception at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:876) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:602) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:214) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:219) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2251) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java: 984) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1074 ) at java.lang.Thread.run(Thread.java:484) Root Cause: java.lang.LinkageError: loader constraints violated when linking org/xml/sax/EntityResolver class at org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:198) at org.apache.jasper.compiler.TldLocationsCache.processWebDotXml(TldLocationsCa che.java:165) at org.apache.jasper.compiler.TldLocationsCache.(TldLocationsCache.java:138) at org.apache.jasper.EmbededServletOptions.(EmbededServletOptions.java:324) at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:263) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:857) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:602) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:214) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at
action mapping difficulties
I am getting a compilation error on my jsp, which seems to indicate a problem with the action mappings. One jsp, the custLogin.jsp compiles fine, whereas the custJoin.jsp throws this exception compiling javax.servlet.ServletException: No getter method for property sFirstName of bean org.apache.struts.taglib.html.BEAN . I do have all of the getters and setters in the customerJoinForm. The action mappings for these two forms seem to be consistent. The relevant code: custJoin.jsp: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % ... html:form action=/custjoin.do ... First Name: td align=left html:text property=sFirstName size=16 maxlength=50//td ... /html:form custLogin.jsp: ... html:form action=/custlogin.do ... struts-config.xml: form-beans !-- Customer join form bean -- form-bean name=customerJoinForm type=com.bmp.action.CustomerJoinForm/ !-- Customer login form bean -- form-bean name=customerLoginForm type=com.bmp.action.CustomerLoginForm/ /form-beans global-forwards forward name=custjoin path=/custJoin.jsp/ forward name=custlogin path=/custLogin.jsp/ /global-forwards action-mappings !-- Process a customer join -- actionpath=/custjoin type=com.bmp.action.CustomerJoinAction name=customerJoinForm scope=request input=/custJoin.jsp validate=true forward name=success path=/custAccount.jsp / forward name=failure path=/error.jsp / /action !-- Process a user logon -- actionpath=/custlogin type=com.bmp.action.CustomerLoginAction name=customerLoginForm scope=request input=/custLogin.jsp validate=true forward name=success path=/custAccount.jsp / forward name=failure path=/custLogin.jsp / /action /action-mappings Any ideas what's going on here? I am using Tomcat3.2.2, Struts 1.0 and Apache1.3.20. Thanks, Alex
ejb and tomcat
Is there a generic setup for getting tomcat to recognize an app servers ejb calls, like certain class_path settings etc
java.lang.IllegalArgumentException: InputStream cannot be null
I'm trying to get struts working with Websphere 3.5.4. I got the example application to work, so I'm pretty sure that I have a configuration problem now. my console output is as follows: 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0048I: Loading servlet: action 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0091I: [Servlet LOG]: action: init 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0091I: [Servlet LOG]: action: Loading application resources from resource com.devcor.tl.rms.prototype.ApplicationResources 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0091I: [Servlet LOG]: action: Initializing configuration from resource path /WEB-INF/struts-config.xml 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0092I: [Servlet LOG]: action: null: java.lang.IllegalArgumentException: InputStream cannot be null at java.lang.RuntimeException.init(RuntimeException.java:49) at java.lang.IllegalArgumentException.init(IllegalArgumentException.java: 45) at javax.xml.parsers.SAXParser.parse(SAXParser.java:73) at org.apache.struts.digester.Digester.parse(Digester.java:755) at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:14 33) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473) at javax.servlet.GenericServlet.init(GenericServlet.java:258) 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0091I: [Servlet LOG]: action: Mapping for servlet 'action' = 'null' 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0130I: Servlet available for service: action I've tried moving the struts-config.xml file, but when I do the output hangs at: 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0091I: [Servlet LOG]: action: Initializing configuration from resource path /WEB-INF/struts-config.xml so I think it is finding the config file. Any idea what the problem could be?
RE: java.lang.IllegalArgumentException: InputStream cannot be null
I think I found a solution to the problem, but I'm not sure why it worked. It was my understanding that websphere didn't look at the web.xml file so I didn't have one. When I copied the web.xml from the example aplication the error went away. If anyone knows whats going on let me know. -Original Message- From: Calabrese, Jason [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 11:29 AM To: '[EMAIL PROTECTED]' Subject: java.lang.IllegalArgumentException: InputStream cannot be null I'm trying to get struts working with Websphere 3.5.4. I got the example application to work, so I'm pretty sure that I have a configuration problem now. my console output is as follows: 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0048I: Loading servlet: action 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0091I: [Servlet LOG]: action: init 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0091I: [Servlet LOG]: action: Loading application resources from resource com.devcor.tl.rms.prototype.ApplicationResources 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0091I: [Servlet LOG]: action: Initializing configuration from resource path /WEB-INF/struts-config.xml 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0092I: [Servlet LOG]: action: null: java.lang.IllegalArgumentException: InputStream cannot be null at java.lang.RuntimeException.init(RuntimeException.java:49) at java.lang.IllegalArgumentException.init(IllegalArgumentException.java: 45) at javax.xml.parsers.SAXParser.parse(SAXParser.java:73) at org.apache.struts.digester.Digester.parse(Digester.java:755) at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:14 33) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473) at javax.servlet.GenericServlet.init(GenericServlet.java:258) 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0091I: [Servlet LOG]: action: Mapping for servlet 'action' = 'null' 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0130I: Servlet available for service: action I've tried moving the struts-config.xml file, but when I do the output hangs at: 7/24/01 10:45 AM : AUDIT [ARZT1000/Default Server]: SRVE0091I: [Servlet LOG]: action: Initializing configuration from resource path /WEB-INF/struts-config.xml so I think it is finding the config file. Any idea what the problem could be?
Re: action mapping difficulties
if you have a property with sFirstName then your getter methos should be getSFirstName(). if this doesn't work try changing your sFirstName to something else in lower case. eg: abc and getter will be getAbc(); hope this helps, rama. - Original Message - From: Sorenson, Alexander [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 11:08 AM Subject: action mapping difficulties I am getting a compilation error on my jsp, which seems to indicate a problem with the action mappings. One jsp, the custLogin.jsp compiles fine, whereas the custJoin.jsp throws this exception compiling javax.servlet.ServletException: No getter method for property sFirstName of bean org.apache.struts.taglib.html.BEAN . I do have all of the getters and setters in the customerJoinForm. The action mappings for these two forms seem to be consistent. The relevant code: custJoin.jsp: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % ... html:form action=/custjoin.do ... First Name: td align=left html:text property=sFirstName size=16 maxlength=50//td ... /html:form custLogin.jsp: ... html:form action=/custlogin.do ... struts-config.xml: form-beans !-- Customer join form bean -- form-bean name=customerJoinForm type=com.bmp.action.CustomerJoinForm/ !-- Customer login form bean -- form-bean name=customerLoginForm type=com.bmp.action.CustomerLoginForm/ /form-beans global-forwards forward name=custjoin path=/custJoin.jsp/ forward name=custlogin path=/custLogin.jsp/ /global-forwards action-mappings !-- Process a customer join -- actionpath=/custjoin type=com.bmp.action.CustomerJoinAction name=customerJoinForm scope=request input=/custJoin.jsp validate=true forward name=success path=/custAccount.jsp / forward name=failure path=/error.jsp / /action !-- Process a user logon -- actionpath=/custlogin type=com.bmp.action.CustomerLoginAction name=customerLoginForm scope=request input=/custLogin.jsp validate=true forward name=success path=/custAccount.jsp / forward name=failure path=/custLogin.jsp / /action /action-mappings Any ideas what's going on here? I am using Tomcat3.2.2, Struts 1.0 and Apache1.3.20. Thanks, Alex
Uploaded file get corrupted after migrating to Struts 1.0
We have recently switched to Struts 1.0 from a previous beta version. After migrating we are having problems in uploading certain files. The files do get uploaded to the server but the contents get corrupted some times. We further investigated this problem and found out that files get damaged when they contains non-English content. For example if we upload a Microsoft Excel file, that contains non-English characters, it got corrupted and we are unable to process that file with MS Excel. The problems disappears if we switch back to old struts.jar file. Any ideas how to fix this problem. Is it safe to replace the struts.jar file with old one as in interim solution?.
RE: Hot to get the iterated objects ?
I'm new to struts, I'm trying to use the iterate tag with to retrieve data from a db and display it. We have the functionality working with our java classes and now I'm trying to incorporate it using struts. The following code illustrates how we are doing it now. % try { sai.db.IRecordIterator it = invoiceService.getStatusSummary(); while (it.next()!=null) { aig.its.db.RecordInvoice rec = (aig.its.db.RecordInvoice) it.current(); % td class=ft%=rec.getGroupCount ()%/td td class=ft$%=rec.getGroupSum (aig.its.db.Tables.Invoice.InvoiceTotal).setScale(2,java.math.BigDecimal.R OUND_DOWN)%/td /tr% if (currentSwapColor==0) currentSwapColor=1; else currentSwapColor=0; } } catch (java.sql.SQLException E) { %%=E.toString()%% } %. Now I'm trying to convert the above iteration using the iterate tag of struts, what I've done is this % try { sai.db.IRecordIterator it = invoiceService.getStatusSummary(); pageContext.setAttribute(it, it, PageContext.PAGE_SCOPE); while (it.next()!=null) { aig.its.db.RecordInvoice rec = (aig.its.db.RecordInvoice) it.current(); pageContext.setAttribute(rec, rec, PageContext.PAGE_SCOPE); % logic:iterate id=item name=it property=rec tr bgcolor=%=swapColor[currentSwapColor]% td align=left bean:write name=rec property=getGroupCount () filter=true/ /td td align=left bean:write name=rec property=getGroupSum (aig.its.db.Tables.Invoice.InvoiceTotal) filter=true/ /td /tr /logic:iterate % if (currentSwapColor==0) currentSwapColor=1; else currentSwapColor=0; } } catch (java.sql.SQLException E) { %%=E.toString()%% } % . I'm getting the exception javax.servlet.ServletException: No getter method for property rec of bean it. I have no idea where I'm going wrong, but I would appreciate if you could help me sort this problem out. Another problem that I'm facing is to convert the following to a struts equivalent command, here I guess the jsp is called based on the multiple params passed to it, I couldn't find anything similar in struts. Please help. td class=fta href=invoice/list.jsp?numFields=1wo0=eqwf0=InvoiceStatuswv0=%=rec.get InvoiceStatus()%%=rec.getInvoiceStatusDescription ()%/a/td B Rgds Raghu -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Monday, July 23, 2001 4:42 PM To: [EMAIL PROTECTED] Subject: Re: Hot to get the iterated objects ? The Struts tags often throw exceptions, but I don't believe any write to a log. They do record the Exception in the request context though, so it can be reported elsewhere (e.g. an JSP error page). Here's an example from interate: else { JspException e = new JspException (messages.getMessage(iterate.iterator)); RequestUtils.saveException(pageContext, e); throw e; } The messages for the exceptions are in taglib\logic\LocalStrings.properties . Sorry I could help with committing the indexed tag, but I haven't had a chance to use it myself. [EMAIL PROTECTED] wrote: Hi Hal, Oleg has siad he will incorporate the tag changes - just mailed him to inquire when he thinks this will take place (I'm on vacation for 2 weeks from this Friday). Am very happy to insert an exception - wasn't sure how the rest of Struts tags handle this type of situation. Does anyone else have a problem with throwing exception, rather than just writing to log? Cheers, Dave Deadman, Hal [EMAIL PROTECTED] on 07/23/2001 01:14:00 PM Please respond to [EMAIL PROTECTED] To: 'Struts Dev List' [EMAIL PROTECTED] cc:(bcc: David Hay/Lex/Lexmark) Subject: RE: Hot to get the iterated objects ? I am looking forward to the seeing indexed tags in the nightly build. Has a commiter signed up to incorporate the indexed tag changes? As for feedback on the code, I don't think it's appropriate to blow off the whole tag without comment if the tag with indexed=true is not nested in an iterate tag. I think an exception should be thrown instead. If an exception isn't thrown then something needs to be written to the log file. change: IterateTag iterateTag = (IterateTag) findAncestorWithClass(this, IterateTag.class); if (iterateTag == null)
RE: Another question about the logic:iterate tag
Yes - yes, and again, yes. Thanks, Ted. To further expound (in the chance that it might help someone else), when one needs to iterate through the key/value pairs of a hashmap, instantiate the object as type Map: Map aMap = new HasMap(); and place it in the request. When you need to retrieve the elements, you can save time by using the struts logic:iterate tag as follows: logic:iterate name=map id=mapEntry scope=request bean:write name=mapEntry property=key/ bean:write name=mapEntry property=value/ /logic:iterate This works b/c the element that gets exposed as the iterator is actually a Map.Entry object, which contains the key value pairs as properties (although this utility is only available during the life of the iteration). Very useful! It reduced my code from a natty 11 lines (see below) down to 4. Feeling *much* better now, Melissa -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 1:35 PM To: [EMAIL PROTECTED] Subject: Re: Another question about the logic:iterate tag id is the name you want to give each item in the map as it iterates. For more see, http://jakarta.apache.org/struts/struts-logic.html#iterate We are about to add more indexing support, which may help you further. See the Indexed Tablibs item at http://husted.com/about/struts/resources.htm#taglibs for an early release. Melissa wrote: I have just tried this, but the id attribute is apparently required. My guess is that this can just be an arbitrary variable... However, the bigger issue seems to be that the iterate tag isn't really suited to the retrieval of more than one oject (i.e. the hashmap's key/value pairs)... here's the old code I was hoping to convert: !--% HashMap jmap = (HashMap)request.getAttribute(hmap); for (Iterator i = jmap.keySet().iterator(); i.hasNext(); ) { String key = (String)i.next(); Object obj = jmap.get(key); % tr tdfont size=1%= key %/font/td tdfont size=1%= obj.toString()%/font/td /tr-- % } % Is there a way to integrate this into a Struts iterate tag, or should i just stick with the original code? Thanks so much for your help. Melissa (Strutting better every day) -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 11:03 AM To: [EMAIL PROTECTED] Subject: Re: Another question about the logic:iterate tag The docs say JSP bean, but the meaning there is broad. So, yes, you can do this: request.setAttribute(hashmap,hashmap); ... logic:iterate name=hashmap To use an actual bean, you would also specify the property logic:iterate name=javaBean property=hashmap which resolves to javaBean.getHashmap() Melissa wrote: Hi again. I am wondering whether the logic:iterate tag requires you to use a bean (or bean property) as the collection to iterate over. I would actually like to iterate over a hashmap that i placed in the request in my action class, but I have not determined through the user docs whether this is possible or not. Any help would be greatly appreciated! Melissa -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/
Re: Hot to get the iterated objects ?
it looks like you just need to change your logic:iterate to point to name=rec without specifing a property... jb - Original Message - From: Raghvendra Sinha [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 2:03 PM Subject: RE: Hot to get the iterated objects ? I'm new to struts, I'm trying to use the iterate tag with to retrieve data from a db and display it. We have the functionality working with our java classes and now I'm trying to incorporate it using struts. The following code illustrates how we are doing it now. % try { sai.db.IRecordIterator it = invoiceService.getStatusSummary(); while (it.next()!=null) { aig.its.db.RecordInvoice rec = (aig.its.db.RecordInvoice) it.current(); % td class=ft%=rec.getGroupCount ()%/td td class=ft$%=rec.getGroupSum (aig.its.db.Tables.Invoice.InvoiceTotal).setScale(2,java.math.BigDecimal.R OUND_DOWN)%/td /tr% if (currentSwapColor==0) currentSwapColor=1; else currentSwapColor=0; } } catch (java.sql.SQLException E) { %%=E.toString()%% } %. Now I'm trying to convert the above iteration using the iterate tag of struts, what I've done is this % try { sai.db.IRecordIterator it = invoiceService.getStatusSummary(); pageContext.setAttribute(it, it, PageContext.PAGE_SCOPE); while (it.next()!=null) { aig.its.db.RecordInvoice rec = (aig.its.db.RecordInvoice) it.current(); pageContext.setAttribute(rec, rec, PageContext.PAGE_SCOPE); % logic:iterate id=item name=it property=rec tr bgcolor=%=swapColor[currentSwapColor]% td align=left bean:write name=rec property=getGroupCount () filter=true/ /td td align=left bean:write name=rec property=getGroupSum (aig.its.db.Tables.Invoice.InvoiceTotal) filter=true/ /td /tr /logic:iterate % if (currentSwapColor==0) currentSwapColor=1; else currentSwapColor=0; } } catch (java.sql.SQLException E) { %%=E.toString()%% } % . I'm getting the exception javax.servlet.ServletException: No getter method for property rec of bean it. I have no idea where I'm going wrong, but I would appreciate if you could help me sort this problem out. Another problem that I'm facing is to convert the following to a struts equivalent command, here I guess the jsp is called based on the multiple params passed to it, I couldn't find anything similar in struts. Please help. td class=fta href=invoice/list.jsp?numFields=1wo0=eqwf0=InvoiceStatuswv0=%=rec.get InvoiceStatus()%%=rec.getInvoiceStatusDescription ()%/a/td B Rgds Raghu -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Monday, July 23, 2001 4:42 PM To: [EMAIL PROTECTED] Subject: Re: Hot to get the iterated objects ? The Struts tags often throw exceptions, but I don't believe any write to a log. They do record the Exception in the request context though, so it can be reported elsewhere (e.g. an JSP error page). Here's an example from interate: else { JspException e = new JspException (messages.getMessage(iterate.iterator)); RequestUtils.saveException(pageContext, e); throw e; } The messages for the exceptions are in taglib\logic\LocalStrings.properties . Sorry I could help with committing the indexed tag, but I haven't had a chance to use it myself. [EMAIL PROTECTED] wrote: Hi Hal, Oleg has siad he will incorporate the tag changes - just mailed him to inquire when he thinks this will take place (I'm on vacation for 2 weeks from this Friday). Am very happy to insert an exception - wasn't sure how the rest of Struts tags handle this type of situation. Does anyone else have a problem with throwing exception, rather than just writing to log? Cheers, Dave Deadman, Hal [EMAIL PROTECTED] on 07/23/2001 01:14:00 PM Please respond to [EMAIL PROTECTED] To: 'Struts Dev List' [EMAIL PROTECTED] cc:(bcc: David Hay/Lex/Lexmark) Subject: RE: Hot to get the iterated objects ? I am looking forward to the seeing indexed tags in the nightly build. Has a commiter signed up to incorporate the indexed tag changes? As for feedback on the code, I don't think it's appropriate to blow off the whole tag without comment if the tag with indexed=true is not nested in an iterate tag. I think an exception should be thrown instead. If an exception isn't thrown then something needs to be written to the log file. change: IterateTag iterateTag = (IterateTag) findAncestorWithClass(this, IterateTag.class); if (iterateTag == null) { // this tag should only be nested in iteratetag, if it's not, don't do anything return
chaining actions
I have two Actions chained together and my appserver is throwing core dumps on me left and right if I issue too many repeat requests. Here are the mappings: action path=/changeTree type=com.yyy.zzz.ChangeTreeAction forward name=nextViewpath=/viewTree.do/ /action action path=/viewTree type=com.yyy.zzz.RetrieveTreeAction scope=request validate=false forward name=showTree path=/generic_treeview.jsp/ /action So I have a jsp that shows a tree. When the user clicks on one of the nodes, the /changeTree request is posted to the ActionServlet. The ChangeTreeAction modifies the tree and then forwards onto the RetrieveTreeAction which forwards back to the jsp view of the tree. My actions use a TreeManager SFSB so I had to synchronize in order to prevent multiple requests from hitting the same SFSB. If I issue too many requests the app server crashes (threads are locking I believe). The perform method in each of the Actions are synchronized. Since the request flow is *always* from ChangeTreeAction to RetrieveTreeAction, I don't see how deadlock can be happening. NOTE: I thought maybe it was some of my code in the perform method so I stubbed out both perform methods to only print a line to the console and it is still happening. If I remove the synchronized blocks, it is all fine. Is there a better way to chain actions? Has anyone experienced anything similar? Thanks, Chris Bono [EMAIL PROTECTED] 512.531.8518 http://www.zilliant.com
RE: Struts on IBM WAS 4.0 - Error removing attributes from request sc ope!
I'm running struts on Websphere 3.5.4 and had similar problems. This is the response I got. Check this out.. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg10964.html And.. Sure thing - I already sent it but the list refused it due to its file size. As an alternative, I'll put it up on my personal FTP space and anyone who wants it can download it from there! :) Struts.jar with Form tag modifications: http://www.enfused.com/struts.jar -Original Message- From: Mark Wilson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 1:07 PM To: '[EMAIL PROTECTED]' Subject: Struts on IBM WAS 4.0 - Error removing attributes from request sc ope! Hello, thanks for you're attention. I am deploying the struts-example app on IBM Websphere App Server 4.0 and receive an IllegalArgumentException - Can't remove attribute from request scope. the situation: I have drilled into the problem and discovered that IBM is using a significantly different implementation of the class, org.apache.jasper.runtime.PageContextImpl. Their class alters the logic of removing attributes using the methods removeAttribute(String s, int i) and removeAttribute(String s). I have included the code in the next section of the e-mail. In summary, using WAS 4.0, attributes are not removed from request scope. This conflicts most directly with the struts framework class, org.apache.struts.taglib.html.FormTag. FormTag calls pageContext.removeAttribute(Constants.BEAN_KEY, PageContext.REQUEST_SCOPE) and pageContext.removeAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE) within the doEndTag() method. Either of these method calls will generate an IllegalArgumentException on WAS 4.0. the code (more or less): org.apache.jasper.runtime.PageContextImpl (note: not the same code as used in tomcat's implementation...) public void removeAttribute(String s, int i) { switch (i) { case PAGE_SCOPE: pageScopeAttributes.remove(s); break; case REQUEST_SCOPE: throw new IllegalArgumentException(Can't remove Attributes from request scope); case SESSION_SCOPE: if (session == null) throw new IllegalArgumentException(Can't access SESSION_SCOPE without an HttpSession); theSession.removeAttribute(s); break; case APPLICATION_SCOPE: theContext.removeAttribute(s); break; } } // and ... public void removeAttribute(String s) { pageScopeAttributes.remove(s); } // (pageScopeAttributes is a Hashtable of objects stored at Page scope only!) a partial solution: Replacing the removeAttribute(String s, int i) method calls with removeAttribute(String s) within the struts class, FormTag.doEndTag() relieves the exception, but on WAS 4.0, it will not remove the attribute! (in fact, only attributes found in page scope will be removed when the method, removeAttribute(String s) is called.) testing results: Even though the attributes weren't removed from the request scope, those attributes were replaced by new objects the next time. This didn't seem to affect the observable behavior of the struts example application. the question(s): We really, really want to use struts on WAS 4.0. There seems to be some logic within struts that relates to null attributes. What are the architectural implications of running an app built upon struts that will never have it's attributes removed from request scope? If there are implications, are there ways to work around the problems? Is it feasible to extend the struts framework to specifically target the changes noted in WAS 4.0? If so, do you have any recommendations how to go about doing this? Thank you very much, Mark
Design Q - Select List Data of possible values of a business object attribute
Good Afternoon... I have a design issue that I am tackling with how to deal with in the struts framework. I have a Shipment class that can have multiple Container objects. Each Container object has an attribute 'typeID' (int) which can have 1 of the following values: 1,2,3,4,5 (as well as other attributes such as size, width, size, number) I have a database table, Container Types, that stores these values and related text descriptions (ID, Desc). The user interface (web) will access the data contained in the Shipment and Container objects. I need to present the user with a select list of the possible options for container type, such that the user sees the descriptions, however the ID is the value that is used to update the object. My questions are: 1. How/Where do I access this 'list' of data that I need for the UI? Do I have a method as part of the Container class to return these values? Do I create a separate utility class? Do I create a collection of objects that represent a 'container type'? I am torn on this issue... 2. Is there a good way to do this while utilizing the struts html tag library? Thanks in advance for any feedback you can provide! Mary Jo
change java statements in jsp
A problem that I'm facing is to convert the following to a struts equivalent command, here I guess the jsp is called based on the multiple params passed to it, I couldn't find anything similar in struts. Please help. td class=fta href=invoice/list.jsp?numFields=1wo0=eqwf0=InvoiceStatuswv0=%=rec.getIn voiceStatus()%%=rec.getInvoiceStatusDescription ()%/a/td B Rgds Raghu winmail.dat
Re: problems mapping multiple ActionServlets
Thanks for your response. I think we'll just have to do some sort of security validation in the Action. Dave On Mon, 23 Jul 2001 15:22:52 -0400 Zeltser, Mark [EMAIL PROTECTED] wrote: Dave, I had the similar problem (see my posting today). I had 2 mappings in web.xml and 2 servlets which extended ActionServlet. Somehow, after I access second servlet my *.do mapping was changed with url-path of second servlet. Don't extend ActionServlet more than once - it will screw up your mapping. Mark. -Original Message- From: Dave Allen [SMTP:310 [EMAIL PROTECTED]] Sent: Monday, July 23, 2001 3:12 PM To: [EMAIL PROTECTED] Subject:problems mapping multiple ActionServlets This might be more appropriate for the Tomcat user list, but I'll try anyway. I'm using Tomcat 3.2.2 and trying to map multiple ActionServlets in web.xml. I have a servlet-mapping for *.do which I execute for the form action search.do, and everything works fine when this is the only servlet-mapping in web.xml. But as soon as I add another servlet-mapping for *.authDo, when I try to execute search.do, search.authDo is called (it even appears in the URL), which I don't understand since I don't call search.authDo from anywhere in my page (or anywhere on the site). If I the change to added mapping to any name, like *.anything, search.anything is called . The pertinent code is below. Many advanced thanks. Dave From the jsp: form:form action=search.do name=caretoolSearchForm type=com.getcare.servlet.CaretoolSearchForm From web.xml: servlet servlet-nameAction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameapplication/param-name param-valuecom.getcare.servlet.ErrorMessages/param-value /init-param init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namevalidate/param-name param-valuetrue/param-value /init-param load-on-startup1/load-on-startup /servlet servlet servlet-nameauthAction/servlet-name servlet-classcom.getcare.servlet.CaretoolActionServlet/servlet-class init-param param-nameapplication/param-name param-valuecom.getcare.servlet.ErrorMessages/param-value /init-param init-param param-nameconfig/param-name param-value/WEB-INF/struts-auth-config.xml/param-value /init-param init-param param-namevalidate/param-name param-valuetrue/param-value /init-param load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameAction/servlet-name url-pattern*.do/url-pattern /servlet-mapping servlet-mapping servlet-nameauthAction/servlet-name url-pattern*.authDo/url-pattern /servlet-mapping -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.
Tomcat/Struts Design Issues and Questions
Struts-users! Sorry if this is not the best forum for this; I am asking this here becuase I think Struts factors into my question. I am creating a web site that allows for the future addition of new webapps to extend the original site. I would like to allow users to make their add on as a full webapp, and I'll store the link to the new webapp in my database. One of the requirements I have is that I need to pass my session onto the new webapp. But, oops, you can't do that. Tomcat (and the Servlet API) doesn't let you pass a session to a new webapp - as far as I can tell. I could pass the important tidbits as strings along in the URL and recreate a session once I get to the new webapp, but that has its own set of problems...it's insecure (no matter how i encode the URL), and it completely messes up the first webapp, becuase when I return to that webapp the session will probably have timed out. Does anyone know of a way that I can maintain a list of trusted webapps which I can pass session between? How about if there is a way to deploy an entire webapp within the context of another? I don't want future developers to need to mess with my code to get their apps into my context. And here is the STRUTS part of my question. If I allow future developers to simply put all of their JSPs/images/templates/etc. into a subdirectory in my webapp, is there a way to allow them to either add their own struts-config.xml file or make struts reread the struts-config.xml file while Tomcat is still running? I also have a requirement of leaving the server running while i deploy so that i don't lose sessions. Any thoughts would be welcome and appreciated. I have looked through archives for Tomcat and Struts and can't seem to find an answer. Thanks in advance! Becky _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
RE: action mapping difficulties
The getters (and setters) were of the form getSFirstName(), but that wasn't working. I changed them to getStFirstName() and it got past that (I still need to change all of the other getSXXX() methods, but it looks like that may fix the problem. Thanks. -Original Message- From: Rama Krishna To: [EMAIL PROTECTED] Sent: 7/24/01 2:39 PM Subject: Re: action mapping difficulties if you have a property with sFirstName then your getter methos should be getSFirstName(). if this doesn't work try changing your sFirstName to something else in lower case. eg: abc and getter will be getAbc(); hope this helps, rama. - Original Message - From: Sorenson, Alexander [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 11:08 AM Subject: action mapping difficulties I am getting a compilation error on my jsp, which seems to indicate a problem with the action mappings. One jsp, the custLogin.jsp compiles fine, whereas the custJoin.jsp throws this exception compiling javax.servlet.ServletException: No getter method for property sFirstName of bean org.apache.struts.taglib.html.BEAN . I do have all of the getters and setters in the customerJoinForm. The action mappings for these two forms seem to be consistent. The relevant code: custJoin.jsp: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % ... html:form action=/custjoin.do ... First Name: td align=left html:text property=sFirstName size=16 maxlength=50//td ... /html:form custLogin.jsp: ... html:form action=/custlogin.do ... struts-config.xml: form-beans !-- Customer join form bean -- form-bean name=customerJoinForm type=com.bmp.action.CustomerJoinForm/ !-- Customer login form bean -- form-bean name=customerLoginForm type=com.bmp.action.CustomerLoginForm/ /form-beans global-forwards forward name=custjoin path=/custJoin.jsp/ forward name=custlogin path=/custLogin.jsp/ /global-forwards action-mappings !-- Process a customer join -- actionpath=/custjoin type=com.bmp.action.CustomerJoinAction name=customerJoinForm scope=request input=/custJoin.jsp validate=true forward name=success path=/custAccount.jsp / forward name=failure path=/error.jsp / /action !-- Process a user logon -- actionpath=/custlogin type=com.bmp.action.CustomerLoginAction name=customerLoginForm scope=request input=/custLogin.jsp validate=true forward name=success path=/custAccount.jsp / forward name=failure path=/custLogin.jsp / /action /action-mappings Any ideas what's going on here? I am using Tomcat3.2.2, Struts 1.0 and Apache1.3.20. Thanks, Alex
RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope!
Hi everyone, I wanted to clarify the status of Struts and Websphere 4 compatability. As a business partner to IBM, we are on the beta testing program for Websphere 4.0 . This particular issue was brought to their attention a couple of weeks ago. Last week we received word that it has been fixed in the latest beta build and will not be an issue in the final GA release. Pravin George, Software Engineer, eBuilt Inc. , Irvine, CA 92614. RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! Date: Tue, 24 Jul 2001 13:16:48 -0700 From: Calabrese, Jason [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] I'm running struts on Websphere 3.5.4 and had similar problems. This is the response I got. Check this out.. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg10964.html And.. Sure thing - I already sent it but the list refused it due to its file size. As an alternative, I'll put it up on my personal FTP space and anyone who wants it can download it from there! :) Struts.jar with Form tag modifications: http://www.enfused.com/struts.jar -Original Message- From: Mark Wilson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 1:07 PM To: '[EMAIL PROTECTED]' Subject: Struts on IBM WAS 4.0 - Error removing attributes from request sc ope! Hello, thanks for you're attention. I am deploying the struts-example app on IBM Websphere App Server 4.0 and receive an IllegalArgumentException - Can't remove attribute from request scope. the situation: I have drilled into the problem and discovered that IBM is using a significantly different implementation of the class, org.apache.jasper.runtime.PageContextImpl. Their class alters the logic of removing attributes using the methods removeAttribute(String s, int i) and removeAttribute(String s). I have included the code in the next section of the e-mail. In summary, using WAS 4.0, attributes are not removed from request scope. This conflicts most directly with the struts framework class, org.apache.struts.taglib.html.FormTag. FormTag calls pageContext.removeAttribute(Constants.BEAN_KEY, PageContext.REQUEST_SCOPE) and pageContext.removeAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE) within the doEndTag() method. Either of these method calls will generate an IllegalArgumentException on WAS 4.0. the code (more or less): org.apache.jasper.runtime.PageContextImpl (note: not the same code as used in tomcat's implementation...) public void removeAttribute(String s, int i) { switch (i) { case PAGE_SCOPE: pageScopeAttributes.remove(s); break; case REQUEST_SCOPE: throw new IllegalArgumentException(Can't remove Attributes from request scope); case SESSION_SCOPE: if (session == null) throw new IllegalArgumentException(Can't access SESSION_SCOPE without an HttpSession); theSession.removeAttribute(s); break; case APPLICATION_SCOPE: theContext.removeAttribute(s); break; } } // and ... public void removeAttribute(String s) { pageScopeAttributes.remove(s); } // (pageScopeAttributes is a Hashtable of objects stored at Page scope only!) a partial solution: Replacing the removeAttribute(String s, int i) method calls with removeAttribute(String s) within the struts class, FormTag.doEndTag() relieves the exception, but on WAS 4.0, it will not remove the attribute! (in fact, only attributes found in page scope will be removed when the method, removeAttribute(String s) is called.) testing results: Even though the attributes weren't removed from the request scope, those attributes were replaced by new objects the next time. This didn't seem to affect the observable behavior of the struts example application. the question(s): We really, really want to use struts on WAS 4.0. There seems to be some logic within struts that relates to null attributes. What are the architectural implications of running an app built upon struts that will never have it's attributes removed from request scope? If there are implications, are there ways to work around the problems? Is it feasible to extend the struts framework to specifically target the changes noted in WAS 4.0? If so, do you have any recommendations how to go about doing this? Thank you very much, Mark
Validation Framework: html tag required for form elements
For the validation framework to operate, is it necessary that struts tags are used to write out form fields? Or is it possible to use plain html? For example, will this work: input type=text name=validateMe value=test Thanks, Matt __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
Re: html:form scripting variable
Perhaps. But sometimes I just want to use the form in a scriplet. Now I have to either covert the attribute to local variable or use bean:define. Why not just create the variable like bean:define does? -- gR - Original Message - From: Erik Hatcher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 7:25 PM Subject: Re: html:form scripting variable It does set a page scoped attribute (keyed by the form name from the mapping) that contains the form object. Erik - Original Message - From: Gregor Rayman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 9:50 AM Subject: html:form scripting variable Hi, why does html:form generate no scripting variable? Would be nice, if it did. -- gR
Re: html:form scripting variable
Perhaps. But sometimes I just want to use the form in a scriplet. Perhaps? Well, it DOES create a page scoped attribute - no perhaps about it! :) I checked the source, FormTag.java. Now I have to either covert the attribute to local variable or use bean:define. Why not just create the variable like bean:define does? But one of the main purposes of Struts is to get away from using scriptlets. - Original Message - From: Erik Hatcher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 7:25 PM Subject: Re: html:form scripting variable It does set a page scoped attribute (keyed by the form name from the mapping) that contains the form object. Erik - Original Message - From: Gregor Rayman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 9:50 AM Subject: html:form scripting variable Hi, why does html:form generate no scripting variable? Would be nice, if it did. -- gR
Re: Validation Framework: html tag required for form elements
It isn't necessary for struts to write out the field as long as the name of the input matches the property name of the field. So in your example you would have a getValidateMe method. I'm assuming your still going through an Action (if not you can still get it to work, but you will have to change some things). David --- Matt Raible [EMAIL PROTECTED] wrote: For the validation framework to operate, is it necessary that struts tags are used to write out form fields? Or is it possible to use plain html? For example, will this work: input type=text name=validateMe value=test Thanks, Matt __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
Re: change java statements in jsp
You would normally have the action put this in scope or make a bean that returns this. There is a paramProperty attribute to call a method on the bean specified in paramName. % java.util.Map params = new java.util.HashMap(); params.put(numFields, 1); params.put(wo0, eq); params.put(wf0, InvoiceStatus); params.put(wv0, rec.getInvoiceStatus()); pageContext.setAttribute(paramMap, params, PageContext.PAGE_SCOPE); % html:link page=invoice/list.jsp paramName=paramMap bean:write name=rec property=invoiceStatusDescription/ /html:link David --- Raghvendra Sinha [EMAIL PROTECTED] wrote: A problem that I'm facing is to convert the following to a struts equivalent command, here I guess the jsp is called based on the multiple params passed to it, I couldn't find anything similar in struts. Please help. td class=fta href=invoice/list.jsp?numFields=1wo0=eqwf0=InvoiceStatuswv0=%=rec.getIn voiceStatus()%%=rec.getInvoiceStatusDescription ()%/a/td B Rgds Raghu ATTACHMENT part 2 application/ms-tnef name=winmail.dat __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
Re: html:form scripting variable
The best thing would be to submit a patch to Bugzilla as an enhancement request and a use-case to DEV to convince someone to commit the patch ;-) -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ Erik Hatcher wrote: No arguments here. It certainly could and it would be a fairly easy modification for it to do so. Perhaps you could post a use-case for why you need it. If you convinced me enough I'd make the changes and submit them as a patch for consideration by the struts-dev group. Or you could make the changes yourself. Erik
Refresh button and Back button
I'm sure many of you have run into these problems before: 1. My form is stored in the session, when the user updates, it goes back to a list screen, the SaveAction servlet removes the form from the session. PROBLEM: A NullPointerException is thrown when the user clicks on the back button. 2. When a user saves a form, they return to the list screen, PROBLEM: Another record gets added to the database. Is there anyway in struts to manipulate the header so the back and refresh think the last page was the current page? Can I do this in the SaveAction servlet? Please offer any workarounds that you have implemented in your struts applications. Thanks, Matt __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
Re: Refresh button and Back button
Basically, the problem is with browsers' caching. For example, IE will ignore header settings you sent. In several references you will find methods to set headers, but they all ignore to recognize that it is after all the browser that decides and/or ignores. Back buttons are developers' nightmare. --- Matt Raible [EMAIL PROTECTED] wrote: I'm sure many of you have run into these problems before: 1. My form is stored in the session, when the user updates, it goes back to a list screen, the SaveAction servlet removes the form from the session. PROBLEM: A NullPointerException is thrown when the user clicks on the back button. 2. When a user saves a form, they return to the list screen, PROBLEM: Another record gets added to the database. Is there anyway in struts to manipulate the header so the back and refresh think the last page was the current page? Can I do this in the SaveAction servlet? Please offer any workarounds that you have implemented in your struts applications. Thanks, Matt __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
Empty Page returned after Action executed
I'm new to Struts (V1.0) and I'm stuck on what I think is a simple example. I have an Action and an ActionForm bean that do pretty much nothing. Action simply returns a reference to continue (mapping.findForward(continue)) and the ActionForm bean has one attribute, title. What's happening is that when I execute the action (using html:link page=/shipsum.do), the JSP associated with the action is not being displayed. There are no errors, just an empty HTML page with an empty body. Here are the form-bean and action entries I use in my config file: form-bean name=summaryForm type=com.mim.pilot2.SummaryForm/ action path=/shipsum type=com.mim.pilot2.SummaryAction name=summaryForm scope=request input=/shipsum.jsp / Note that by using System.out I have verified that my SummaryAction class is being executed. And... it also does not work if I specify forward as shown below: action path=/shipsum type=com.mim.pilot2.SummaryAction name=summaryForm scope=request input=/shipsum.jsp forward name=success path=/shipsum.jsp/ /action But... if I use the entry: action path=/shipsum forward=/shipsum.jsp / shipsum.jsp is displayed correctly. Under what conditions does Struts return an empty HTML page? Can someone spot my error? Thanks, = Randall Dietz IT Consultant Email: [EMAIL PROTECTED] ** The information contained in this e-mail is confidential and is intended only for the use of the addressee(s). If you receive this e-mail in error, any use, distribution or copying of this e-mail is not permitted. You are requested to forward unwanted e-mail and address any problems to the MIM Holdings Limited Support Centre. e-mail: [EMAIL PROTECTED] phone: Australia 1800500646 International ++61 7 38338042 **
Strut and EJB/J2EE
Hi all, Sorry for naive question. I'm new to Struts - just construct some simple examples by myself... It seems to me that applications that use Struts are web-centric. I wonder where EJB comes into play? And is it easy to migrate Struts apps to J2EE applications...? Is Struts (alone) suitable for large scale applications, without being a J2EE app? Thanks, - Chuong = HUYNH, N. CHUONG TMA Software Solutions, Vietnam Tel: (84-8) 990 3848 - Ext: 5272 Email: [EMAIL PROTECTED] =