Throwing exceptions in Actions
(Using tomcat here) Anyone know what the story is with the 'friendly' (using the Micro$oft definition of 'friendly' here) apache exception messages reported when an exception is thrown from within a dispatch action? ie: Apache Tomcat/4.0.3 - HTTP Status 500 - Dispatch[/partnerTypeDispatchAction] to method save returned an exception Not very helpful really. Not even anything in the logs :-( The exception in question is one (a ServletException with nested exceptions) I myself throw in the code under certain conditions, and I wish to display it in a similar manner to exceptions I throw from a normal (ie: not struts actionservlet) servlet. That is: I wish to inspire the fear of god in the poor fool who clicked the wrong thing by showing a lovely 5000 lines long nested exceptions stack trace How to configure this? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Throwing exceptions in Actions
testing -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 2:54 PM To: Struts Subject: Throwing exceptions in Actions (Using tomcat here) Anyone know what the story is with the 'friendly' (using the Micro$oft definition of 'friendly' here) apache exception messages reported when an exception is thrown from within a dispatch action? ie: Apache Tomcat/4.0.3 - HTTP Status 500 - Dispatch[/partnerTypeDispatchAction] to method save returned an exception Not very helpful really. Not even anything in the logs :-( The exception in question is one (a ServletException with nested exceptions) I myself throw in the code under certain conditions, and I wish to display it in a similar manner to exceptions I throw from a normal (ie: not struts actionservlet) servlet. That is: I wish to inspire the fear of god in the poor fool who clicked the wrong thing by showing a lovely 5000 lines long nested exceptions stack trace How to configure this? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Throwing exceptions in Actions
Umm. Where do I put this 'testing'? Is that on the command line, or should I put it somewhere in struts-config.xml? ;-) -Original Message- From: Sudhir [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 15:20 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Throwing exceptions in Actions testing -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 2:54 PM To: Struts Subject: Throwing exceptions in Actions (Using tomcat here) Anyone know what the story is with the 'friendly' (using the Micro$oft definition of 'friendly' here) apache exception messages reported when an exception is thrown from within a dispatch action? ie: Apache Tomcat/4.0.3 - HTTP Status 500 - Dispatch[/partnerTypeDispatchAction] to method save returned an exception Not very helpful really. Not even anything in the logs :-( The exception in question is one (a ServletException with nested exceptions) I myself throw in the code under certain conditions, and I wish to display it in a similar manner to exceptions I throw from a normal (ie: not struts actionservlet) servlet. That is: I wish to inspire the fear of god in the poor fool who clicked the wrong thing by showing a lovely 5000 lines long nested exceptions stack trace How to configure this? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
how to use reset()?
I'm having a formbean which contains data from some ejb (object containing some id's, descriptions and boolean values). In my actionclass I get this bean from the session and fill it with the data from the ejb. Then in my formular I'm just having checkboxes to edit the boolean values (means not all values of the bean are in some field). When the submitbutton is pressed the data gets send back. Then struts calls the reset() method of the bean and fills up the data with the values from the form. (please correct me when I'm wrong). When I wanna save the values of the form (sending the obj to the ejb) now and my reset() method throws away or resets all the data filled up in the previous actionclass, I have to load the data again, change the edited data and then send it to the ejb. But if my reset() method just sets all boolean values to false (cause only selected checkboxes return some value) I can take the data from the session as it comes and send it to the ejb. So is it really necessarry to reset all data in the reset() method? How do you do handle this? And could you please write me how best to handle the ammount of data hold in the session? (delete the data after saving, set the scope to request) Hanel Matthias Fachinformatiker (Anwendungsentwicklung) in Ausbildung Logistik World GmbH Fon:+49-841-9014-300 Marie-Curie-Strasse 6 Fax:+49-841-9014-302 D- 85055 Ingolstadt mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Struts book bug?
Chuck, you are perfectly right. I have it defined in my web.xml and DTD says that it must be defined. Sorry for the wrong feedback. Anyway I am reading the book and is really worth. Regards, Adolfo, It is required according to the DTD and the source code, because there is not default specified. However, I think I may know how it's working for you. I'm just guessing here however. Do you have the properties file specified in the web.xml? Version 1.1 supports backwards-compatibility with 1.X and it will still load the message resources from the web.xml for the default application. It may be getting the message resources for the default application from there. Take a look at the defaultMessageResourcesConfig() method in the ActionServlet class. There's a note that this will be removed in a later release. This might be how it's not breaking for you, I'm not really sure. I didn't see anywhere a default message bundle name is being set. Maybe we're looking at different versions? Chuck At 04:35 PM 6/11/2002 +, you wrote: I read in chapter 4, in message-resources element definition of parameters that the parameter parameter is required. I think this is not rtue, since I am able to leave it blank and Struts assigns the default one org.apache.struts.action.MESSAGE/mi_subapplication as key in the ServletContext for this bundle. Adolfo. HTML HEAD TITLEAdolfo's signature/TITLE /HEAD BODY centerbemAdolfo Rodriguez Miguelez/emb/center /BODY /HTML _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How to create dynamic list of checkboxes
Hi, I am a newcomer to Struts. I have a requirement where in which i have to create a dynamic list of checkboxes(the number of checkboxes will vary at each request). From my knowledge of Struts i was able to comprehend that i would have to create a FormBean for the form i have with properties corresponding to all the checkboxes. Since i dont know beforehand how many checkboxes will be there how can i develop the FormBean which caters to such dynamic number of checkboxes. Can i have a ArrayList the way select tag is used. Thanks in Advance Rakesh **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to create dynamic list of checkboxes
Create ur form only to have an arraylist or a collection object, and the collection object Will hold a list of info objects, an attribute of ur info object would be ur checkbox attribute. -Original Message- From: Rakesh N R [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 2:32 PM To: Struts Users Mailing List Subject: How to create dynamic list of checkboxes Hi, I am a newcomer to Struts. I have a requirement where in which i have to create a dynamic list of checkboxes(the number of checkboxes will vary at each request). From my knowledge of Struts i was able to comprehend that i would have to create a FormBean for the form i have with properties corresponding to all the checkboxes. Since i dont know beforehand how many checkboxes will be there how can i develop the FormBean which caters to such dynamic number of checkboxes. Can i have a ArrayList the way select tag is used. Thanks in Advance Rakesh **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
workflow example explaination.
Hi All, can anybody explain me the foll struts-config.xml...?? Especially set-property tag supposed to do ...?? I've picked up this file from struts workflow example. struts-config.xml ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.0//EN http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd; !-- This is the Struts configuration file for the workflow example application. -- struts-config !-- == Form Bean Definitions === -- form-beans !-- Login form bean -- form-bean name=loginForm type=com.livinglogic.struts.workflow.test.LoginForm/ /form-beans !-- == Global Forward Definitions == -- global-forwards !-- this happens, when an authentication exception is thrown -- forward name=authenticationexception path=/authenticationException.jspp / !-- this happens, when we are in maintenance mode, i. e. debug level is -1 -- forward name=maintenance path=/maintenance.jspp / !-- this happens, if the workflow data do not match -- forward name=controlflowexception path=/controlFlowException.jspp/ !-- this happens, when any kind of exception occurs in one of the actions and debug level is 0 -- forward name=exception path=/exception.jspp / /global-forwards !-- == Action Mapping Definitions == -- action-mappings !-- = Login/logout workflow = -- !-- Display login -- action path=/displayLoginAction type=com.livinglogic.struts.workflow.SuccessAction set-property property=primaryWorkflow value=login / set-property property=newState value=1 / set-property property=nextState value=2 / forward name=success path=/login.jspp / /action !-- Execute login -- action path=/loginAction type=com.livinglogic.struts.workflow.test.LoginAction name=loginForm scope=request input=/login.jspp set-property property=primaryWorkflow value=login / set-property property=prevState value=1 / set-property property=newState value=2 / set-property property=endWorkflow value=true / forward name=success path=/displayInHomeAction.do / /action !-- Execute logout -- action path=/logoutAction type=com.livinglogic.struts.workflow.test.LogoutAction forward name=success path=/displayLoginAction.do / /action !-- Display the main page after login -- action path=/displayInHomeAction type=com.livinglogic.struts.workflow.SuccessAction set-property property=authtype value=com.livinglogic.struts.workflow.test.Authentication / forward name=success path=/inHome.jspp / /action action path=/beginWf1Transition type=com.livinglogic.struts.workflow.test.Wf1Action set-property property=authtype value=com.livinglogic.struts.workflow.test.Authentication / set-property property=primaryWorkflow value=wf1 / set-property property=newState value=1 / set-property property=nextState value=2 / forward name=success path=/inHome.jspp / /action action path=/wf1St2Transition type=com.livinglogic.struts.workflow.test.Wf1Action set-property property=authtype value=com.livinglogic.struts.workflow.test.Authentication / set-property property=primaryWorkflow value=wf1 / set-property property=prevState value=1 / set-property property=newState value=2 / set-property property=nextState value=2 / set-property property=nextState value=3 / forward name=success path=/inHome.jspp / /action action path=/wf1St2Loop type=com.livinglogic.struts.workflow.test.Wf1Action set-property property=authtype value=com.livinglogic.struts.workflow.test.Authentication / set-property property=primaryWorkflow value=wf1 / set-property property=prevState value=2 / set-property property=nextState value=2 / set-property property=nextState value=3 / forward name=success path=/inHome.jspp / /action action path=/wf1St3Transition type=com.livinglogic.struts.workflow.test.Wf1Action set-property property=authtype value=com.livinglogic.struts.workflow.test.Authentication / set-property property=primaryWorkflow value=wf1 / set-property property=newState value=3 / set-property property=nextState value=0 / forward name=success path=/inHome.jspp / /action action path=/endWf1Transition type=com.livinglogic.struts.workflow.test.Wf1Action set-property property=authtype value=com.livinglogic.struts.workflow.test.Authentication / set-property property=primaryWorkflow value=wf1 / set-property property=prevState value=3 / set-property property=newState value=0 / set-property property=endWorkflow value=true / forward name=success path=/inHome.jspp / /action action path=/beginWf2Transition
[ann] Easy Struts 0.2 for Eclipse users
Hi, Easy Struts 0.2 for Eclipse is out *Features - Wizard for action, form, jsp creation - Create Run with Tomcat Sysdeo Plugin *Changes - Wizard for forward creation added - Distribution - Some fix *More : - http://sourceforge.net/projects/easystruts - http://easystruts.sourceforge.net/ Enjoy, -Emmanuel ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
struts-example BEA Weblogic
Hi everyboy i am using BEA Weblogic ver. 5.1 with service pack 12 i would like to run the struts-example on BEA Weblogic. but i get the following exception: Mi Jun 12 12:42:51 GMT+02:00 2002:I ServletContext-strutsexample resolving taglib uri '/WEB-INF/struts-bean.tld' to taglib-location /WEB-INF/struts-bean.tld: Mi Jun 12 12:42:52 GMT+02:00 2002:I ServletContext-strutsexample resolving taglib uri '/WEB-INF/struts-html.tld' to taglib-location /WEB-INF/struts-html.tld: Mi Jun 12 12:42:53 GMT+02:00 2002:I ServletContext-strutsexample resolving taglib uri '/WEB-INF/struts-logic.tld' to taglib-location /WEB-INF/struts-logic.tld: Mi Jun 12 12:42:54 GMT+02:00 2002:I ServletContext-strutsexample Generated java file: C:\tomcat403\webapps\struts-example\_tmp_war\jsp_servlet\_index.java Mi Jun 12 12:42:56 GMT+02:00 2002:E ServletContext-strutsexample Servlet failed with Exception javax.servlet.ServletException: runtime failure in custom tag 'html' at jsp_servlet._index._jspService(_index.java, Compiled Code) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :105) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :123) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp l.java:742) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp l.java:686) at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext Manager.java:247) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code) Mi Jun 12 12:42:56 GMT+02:00 2002:E ServletContext-strutsexample root cause of ServletException javax.servlet.ServletException: runtime failure in custom tag 'message' at jsp_servlet._index._jspService(_index.java, Compiled Code) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :105) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :123) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp l.java:742) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp l.java:686) at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext Manager.java:247) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code) Mi Jun 12 12:42:57 GMT+02:00 2002:I ServletContext-General servletimages: init Thanks Ebi -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
JSP - FORMS input tag, Question
Hi, i have a question: i have a jsp: html:form action=a .. html:text property=name / .. what i need to do for this field showed filled like e passed in the parameter os the jsp like : aaa.do?name=bill OR i need to passed a the form for the corresponding action Can anyone help me ?? thanks Strunts config: .. form-bean name=aForm type=bla.bla.aForm / . actionpath=/aaa type=bla.bla.aAction name=aForm scope=request validate=true /action -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: radio button into an iterate tag...
Subject: Re: radio button into an iterate tag... From: Andrew Shouldice [EMAIL PROTECTED] === What I did was set a value in my constructor of the radio button I wanted. [EMAIL PROTECTED] wrote: Hi, (Sorry for my english... I will try hard to explain my problem correctly) I have a big problem with my radio buttons... I have a list of radio buttons that are populate from the database with a collection... with an iterate tag. The problem is : the last radio button is checked by default. And when I look to the source(view source on the browser) I can see that all the radio buttons are checked. Maybe it's the reason of why it's the last radio button that is check. I want to know how to have just one radio button checked and how I can have the good radio button pressed by the client before sending the form... Maybe I was not clear.. just let me know... Here is a portion of my code... ---(jsp page) logic:iterate id=user type=cipo.tm.paladin.model.UserDetails name=userListForm property=children scope=session tr td width=100form:radio name=user property=userId value=%= user.getUserId() % bean:write name=user property=userId scope=page //form:radio/td td width=100bean:write name=user property=depositAccount scope=page //td td width=100bean:write name=user property=descriptionE scope=page //td /tr /logic:iterate -(form bean) /** * The collection of children for the root agentNumber. */ private Collection children = null; /** * Property setter for children. Used to populate the list of children for the * agent identified by agentNumber. * @param children A collection of Agents. */ public void setChildren(Collection children) { this.children = children; } /** * Property getter for children. * @return A collection of Agents. */ public Collection getChildren() { return this.children; } --(action) public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Extract attributes we will need Locale locale = getLocale(request); MessageResources messages = getResources(); HttpSession httpSession = request.getSession(); Enumeration attrbNames = request.getAttributeNames(); Enumeration paramNames = request.getParameterNames(); String operation = ((UserListForm) form).getOperation(); UserCatalogHelper userCatalog = new UserCatalogHelper(); Collection userInfo = new Vector(); // Validate the request parameters specified by the user ActionErrors errors = new ActionErrors(); // Lookup the operation based on locale if (operation.equals(messages.getMessage(locale, submit.administer))){ operation = new String(success); // default access to home page AgentDetails agentInfo = (AgentDetails) httpSession.getAttribute(Constants.ADMINISTER_AGENT); String abbreviatedName = agentInfo.getAbbreviatedName(); ((UserListForm) form).setAbbreviatedName(abbreviatedName); Integer agentNumber = agentInfo.getAgentNumber(); try { userInfo = userCatalog.getUsersByAgent(agentNumber); ((UserListForm) form).setChildren(userInfo); }catch (cipo.tm.paladin.web.controller.CatalogException cx) { errors.add(agentNumber,new ActionError(errors.agent.administer.nousers)); } Brigitte Lavoie -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: User Authentication
Subject: Re: User Authentication From: David Bolsover [EMAIL PROTECTED] === Hi all I am pleased that my posting provoked so may interesting responses; I was particularly intrigued by the reference to Open Symphony - OSUser module - thanks to Kevin Palfreyman for that. Sadly, since Open Symphony - OSUser module is still under developement, it does not solve my present need. There were several references to the 'roles' model - which I already use in the application I'm developing; indeed, it would be difficult without using roles. I do not want to have to define new roles for each new user and his particular access privileges - it is just too difficult to manage. I will follow up on the OSUser module link and post back to the group when I have more information. David Bolsover -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JSP - FORMS input tag, Question
Hi You can set the default values in the reset method in the ActionForm. Hope this helps. Ramón. -Mensaje original- De: João Cerdeira [mailto:[EMAIL PROTECTED]] Enviado el: miércoles, 12 de junio de 2002 12:59 Para: [EMAIL PROTECTED] Asunto: JSP - FORMS input tag, Question Hi, i have a question: i have a jsp: html:form action=a .. html:text property=name / .. what i need to do for this field showed filled like e passed in the parameter os the jsp like : aaa.do?name=bill OR i need to passed a the form for the corresponding action Can anyone help me ?? thanks Strunts config: .. form-bean name=aForm type=bla.bla.aForm / . actionpath=/aaa type=bla.bla.aAction name=aForm scope=request validate=true /action -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Disbaling Back Button of Browser
You can't truly disable back and forward. You can open your site without the buttons, but there are still ways for the user to issue back and forward (ALT+LEFT ALT+RIGHT). Thus, you have to resort to javascript tricks. Do a google search in comp.lang.javascript. There are tons of postings there on this very topic. -Original Message- From: Daniel J. D'Cotta [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 1:57 AM To: [EMAIL PROTECTED]; sanjeev_dutt Cc: Struts Users List Subject: RE: Disbaling Back Button of Browser body onload=javascript:history.forward(); Thanks, that works... ...but a new request is done; and I guess that the old request scope is lost. Is there any better way to disable back and forward (and also the history)? -Original Message- From: sanjeev_dutt [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 12:11 PM To: Daniel J. D'Cotta; [EMAIL PROTECTED] Subject: RE: Disbaling Back Button of Browser you should try : body onload=javascript:history.forward(); -Original Message- From: Daniel J. D'Cotta [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 9:38 AM To: [EMAIL PROTECTED] Cc: sanjeev_dutt Subject: RE: Disbaling Back Button of Browser hi, I tried ... .. but it does not seem to do anything. What am I doing wrong? Regards, Daniel -Original Message- From: Narasimha Rao [mailto:[EMAIL PROTECTED]] Sent: Monday, June 10, 2002 6:55 PM To: Struts Users Mailing List Subject: RE: Disbaling Back Button of Browser hi, use history.forward()in the body of the page cheers narasimha -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Réf. : RE: Dealing with many JSP files with oneAction
Yes, I understand what you need. You are trying to use Struts to forward to a jsp depending on Locale (and some other param). I'm not sure how you plan to capture from the user's 'param' such as country. Perhaps your own authentication mechanism is storing the user to country relation. Still, I think you'd be better off structuring your site to use one codebase. Here's an example of what I mean: (I'm typing this as I go, so forgive me if I miss something) + app + i18n + en + images + stylesheets + (other web content) + fr + images + stylesheets + (other web content) + de + images + stylesheets + (other web content) + WEB-INF + classes + lib + jsp + tld + xml #1. Then in you create ApplicationResources.properties images.logo={0}/images/logo.gif images.logo.alt=Company Logo global.title=My i18n website #2. Now, create a ApplicationResources_fr.properties images.logo={0}/images/frenchlogo.gif images.logo.alt=Logo De Compagnie global.title=Mon website d'i18n #3. also create one for German (ApplicationResources_de.properties) images.logo={0}/images/germanlogo.gif images.logo.alt=Firma-Firmenzeichen global.title=Mein i18n website When displaying the html:img, be sure to insert the locale. Now, your content is separated from your code. Use the force Luke. 1 Codebase - Many Languages Do you see how easy it is? All you have to do is copy the 'en' file structure, the rename 'en' to whatever. Then have your folks update with that language versions. + en + images + stylesheets + (other web content) Also create a ApplicationResources_{lang}.properties where {lang} is the two letter abrev. for the locale The same codebase will correctly use the version for the users locale. You may need to specify local for misc items like .css or other files (.swf, .js, .xls). If this makes no sense to you Please read: http://husted.com/struts/FAQ/view-i18n.htm Let me know if you have further issues. James Mitchell Software Engineer\Struts Evangelist Struts-Atlanta, the Open Minded Developer Network http://struts-atlanta.open-tools.org -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 3:19 AM To: [EMAIL PROTECTED] Subject: Réf. : RE: Dealing with many JSP files with oneAction Hi ! Well, either I did not explain my problem well enough or I don't understand your solution. You said So that way you can forward to the jsp for the appropriate language. And each jsp will refer to its appropriate images. I don't understand how I am going to forward to the right jsp file in the right directory without writing it down explicitely in my struts-config.xml file. Suppose I use the ForwardAction class ; what should I put inside the 'parameter' attribute so that it will forward to the right file in the right directory relatively to the page I am currently seeing in my browser ? I understand that i18n allows me to choose files (jsp, images, or whatever) depending on my Locale, but in my case, the Locale is not the only parameter : the country and the language are going to be important on the decision making. So I am going to have a french site in french, but also an english version of the french site, the same for Spain, etc. Sorry if my questions are too basic, and thanks again for taking the time to answer me. Olivier Schmeltzer [EMAIL PROTECTED] le 11/06/2002 16:28:38 Veuillez répondre à [EMAIL PROTECTED] Pour : [EMAIL PROTECTED] cc : Objet : RE: Dealing with many JSP files with one Action First of all, it helps to include the original textor at least part it: James Mitchell wrote: Have you considered taking advantage of Struts i18n capabilities? By stripping out all display text (including button values) into the message resource files, you can better manage the content display by managing your i18n-ed files. You will realize the return on investment almost immediately if you were to.oh lets say .change the workflow of your site, or change the layout. You would only have to make the change in one place and not multiple files. I'll add my comments below. James Mitchell Software Engineer\Struts Evangelist Struts-Atlanta, the Open Minded Developer Network http://struts-atlanta.open-tools.org -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 3:02 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: Dealing with many JSP files with one Action Thanks for your answer. Unfortunately, I am not able to modify the directory structure and all the way this is going to work. I didn't say anything about modifying the dir structure We don't want to just have the
Re: JSP - FORMS input tag, Question
Hi, My question is not that my question is: i need to pass to the jsp the values of the html fields not the default values If you can help thanks Ramón Prades wrote: Hi You can set the default values in the reset method in the ActionForm. Hope this helps. Ramón. -Mensaje original- De: João Cerdeira [mailto:[EMAIL PROTECTED]] Enviado el: miércoles, 12 de junio de 2002 12:59 Para: [EMAIL PROTECTED] Asunto: JSP - FORMS input tag, Question Hi, i have a question: i have a jsp: html:form action=a .. html:text property=name / .. what i need to do for this field showed filled like e passed in the parameter os the jsp like : aaa.do?name=bill OR i need to passed a the form for the corresponding action Can anyone help me ?? thanks Strunts config: .. form-bean name=aForm type=bla.bla.aForm / . actionpath=/aaa type=bla.bla.aAction name=aForm scope=request validate=true /action -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Nested Tags question
Hi All, I am trying to save a list created with the nested:iterate tag (from an object array in my form bean). I've written my code by following the SaveMonkey example from Arron Bates' KeyboardMonkey site (kudos to you, capt'n) - but the object array doesn't get recreated on a submit! Can I use a nested:iterate tag on an array straight out of the form bean? That seems to be the only difference I can see between mine and the SaveMonkey demo. The setList(Object[] newList) isn't working. Struts or Tomcat isn't recognising it as a normal javabean property setter I guess. Here's what the HTML looks like: form name=operationForm method=POST action=/apla/operationList.do input type=hidden name=list[0].opIdString value=31 input type=text name=list[0].packageName value=Pack1 Should I keep looking for a bug that's stopping the setList() method from being recognised as a setter method? Thanks if you can help, Adam -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[ANNOUNCE] Struts Console v1.12.1
Struts Console version 1.12.1 is now available. http://www.jamesholmes.com/struts/ Download Now: http://www.jamesholmes.com/struts/struts-console-1.12.1.zip -- OR -- http://www.jamesholmes.com/struts/struts-console-1.12.1.tar.gz Struts Console is FREE software. This release is a bug fix release and does not introduce any new functionality. Changes with Struts Console v1.12.1 *) Fixed bug where the Action screen was not properly updating the Type/Forward/Include data properly. *) Fixed bug where the Newlines output option was not correctly setting the newline. *) Fixed bug where Indent Elements output option allowed for an empty value which caused the app to throw exceptions. *) Fixed console.sh Unix startup script to correctly set the classpath for invoking the standalone Struts Console. Thanks, -james [EMAIL PROTECTED] http://www.jamesholmes.com/struts/ __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[ANNOUNCE] Artimus .04 example app posted
An updated version of the Artimus example application is now available at: http://www.husted.com/struts/resources/artimus.zip See the README.TXT to get started. This application demonstrates some of the design strategies discussed on the list recently * The business tier is represented by a set of ProcessBeans, dispatched using the Command pattern. * A framework Action is used to dispatch the ProcessBeans. The bean type is specified using the parameter property. * The framework Action (ProcessAction) returns a data transfer object (ResultList), designed for use by the presentation layer. Other goodies include * SQL commands are stored in external properties files and can be changed without recompiling. * All SQL commands are processed through a pair of easy-to-use static methods. * ResultSets are automatically transferred to a collection of beans. * A connection pool adapter allows use of the Struts connection pool from the business tier (and I said it couldn't be done :o). Other pools (Poolman, Resin, et cetera) may be configured through the web.xml. * Lucene is used side-by-side with JDBC to provide better searching when appropriate. * A helper servlet is used to load custom resources so ActionServlet does not need to be subclassed. * Appication settings can be configured through the web.xml or a properties file. Most of these come out of the updated Scaffold package that is bundled in this distribution. The versions of Artimus and Scaffold in the Apache-Struts CVS will be updated shortly. There will be another posting soon that will feature Tiles and the Struts-Validator, among other things. -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Value of using one action per use-case?
Hi At a Java Conference it was suggested that when building web applications with Struts it might be a good idea to use one action per use case. In the action we have a number of different methods that would would be executed depending on the parameters passed by the browser. The methods would be automatically invoked by reflection. Other than the slight performance hit due to reflection, would this be a good idea? Why or why not? TIA Karim -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tilesPlugin, tiles struts subapps
Subject: Re: tilesPlugin, tiles struts subapps From: Torgeir Veimo [EMAIL PROTECTED] === Torgeir Veimo wrote: Well, looking at the plugin, it only seems to save the configDefinition property to a private property, accessible with getDefinitionsConfig(). But this method isn't called from anywhere. To answer myself I implemented the init() method in the TilesPlugin, like this; public void init(ApplicationConfig config) throws ServletException { ComponentDefinitionsFactory factory = DefinitionsUtil.getDefinitionsFactory(config.getServlet().getServletContext()); if (factory != null) return; config.getServlet().log(initializing tile with definition; + definitionsConfig); Map properties = new HashMap(); // Read properties // Not so nice, but works for default factory ;-( properties.put( I18nFactorySet.DEFINITIONS_CONFIG_PARAMETER_NAME, definitionsConfig); // didn't know if this was needed, so I commented it out.. /*try { factory = DefinitionsUtil.createDefinitionsFactory(config.getServlet().getServletContext(), properties, classname); } catch( DefinitionsFactoryException ex ) { ex.printStackTrace(); throw new JspException( ex.getMessage() + See console for details ); }*/ } I don't think this will provide complete subapplication support. Any comments? -- -Torgeir -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Value of using one action per use-case?
My experience building Struts apps tells me that this could lead to some overly-complex Actions without adding significant value. If you consider a single Use Case such as Maintain User Information, the use case could easily span several pages. Managing the information on each page may lead to different exception paths (with each requiring individual views), Thus you could have potentially 2-3 views per step (over several steps) driven by one controller. In addition, if the use case changed significantly, it may be easier to maintain code that was segregated into independent controllers. If one part of the use case changed, controllers for the other parts may not require changing. If there was only a single controller then maintenance may be more complex than it need be. Incorporating all the logic required for managing each of the various pages submissions seems as if it could make the methods longer and more complex - without adding any real value. What value was it suggested might be added by taking this approach? Given my experience, I'd actually say it is more likely that a single Form Bean per use case would make sense - after all , sometimes data gathered in one step of a Use Case is useful in later steps. And validation in later steps may be dependent upon data gathered in earlier steps. But even this is a generalizationm that wouldn't always be true. Kevin Karim D. Saloojee [EMAIL PROTECTED] on 06/12/2002 09:49:54 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User [EMAIL PROTECTED] cc:(bcc: Kevin Bedell/Systems/USHO/SunLife) Subject: Value of using one action per use-case? Hi At a Java Conference it was suggested that when building web applications with Struts it might be a good idea to use one action per use case. In the action we have a number of different methods that would would be executed depending on the parameters passed by the browser. The methods would be automatically invoked by reflection. Other than the slight performance hit due to reflection, would this be a good idea? Why or why not? TIA Karim -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Validator and DispatchAction
Hi ! I have a UserForm, the fields are : userId and userName. I have a UserAction that extends DispatchAction. The UserAction have two methods (insert and update). For the insert method only the userName is required, and for update method the userId and the userName are required. How can I can do a dependency validation with the validator.xml ? Thanks, William. _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Value of using one action per use-case?
Use cases are highly variable between authors, projects, companies, etc. : My use case is not your use case.. Some are high-level, some medium-level, and some low-level. So the answer really depends on the level and domain of the use case. Some use cases will likely match Actions, others a combination of Actions. And some will have no relationship to Actions. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 9:56 AM To: Struts Users Mailing List Subject: Re: Value of using one action per use-case? My experience building Struts apps tells me that this could lead to some overly-complex Actions without adding significant value. If you consider a single Use Case such as Maintain User Information, the use case could easily span several pages. Managing the information on each page may lead to different exception paths (with each requiring individual views), Thus you could have potentially 2-3 views per step (over several steps) driven by one controller. In addition, if the use case changed significantly, it may be easier to maintain code that was segregated into independent controllers. If one part of the use case changed, controllers for the other parts may not require changing. If there was only a single controller then maintenance may be more complex than it need be. Incorporating all the logic required for managing each of the various pages submissions seems as if it could make the methods longer and more complex - without adding any real value. What value was it suggested might be added by taking this approach? Given my experience, I'd actually say it is more likely that a single Form Bean per use case would make sense - after all , sometimes data gathered in one step of a Use Case is useful in later steps. And validation in later steps may be dependent upon data gathered in earlier steps. But even this is a generalizationm that wouldn't always be true. Kevin Karim D. Saloojee [EMAIL PROTECTED] on 06/12/2002 09:49:54 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User [EMAIL PROTECTED] cc:(bcc: Kevin Bedell/Systems/USHO/SunLife) Subject: Value of using one action per use-case? Hi At a Java Conference it was suggested that when building web applications with Struts it might be a good idea to use one action per use case. In the action we have a number of different methods that would would be executed depending on the parameters passed by the browser. The methods would be automatically invoked by reflection. Other than the slight performance hit due to reflection, would this be a good idea? Why or why not? TIA Karim -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[ANN BUG-FIX] Easy Struts v0.2.1
Hi, Easy Struts v0.2.1 is out, This release in only bug fix. Bug fix From v0.2 Fix : Unable to finish the wizards. Fix : JSP was not created. http://sourceforge.net/project/showfiles.php?group_id=54542release_id=94400 http://easystruts.sourceforge.net/ Sorry ... and Thanx Dan -Emmanuel --- Daniel Rolph [EMAIL PROTECTED] a écrit : Hello, I have Eclipse 2.0 Build 20020602 with the Tomcat plugin v0.99 and Easy Struts 0.2. When using the Easy Struts wizard to create an Action, Form, and Input in my Tomcat project, the wizard works fine up to the point of pushing the Finish button on the 4th option page. No matter what I do, the wizard never appears to complete. The interface for Easy Struts looks terrific! Would you be able to give me any advice to help me out with the problem that I am having? Thank you very much. Take care, Dan Daniel Rolph BIT Systems [EMAIL PROTECTED] 703-742-7660 ext. 119 ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Nested Tags question
Hi folks, I'm going nuts having a very unproductive day here trying to save these nested tags as I mentioned earlier. I've boiled down my ignorance so to speak to the following question: How or why is the following input tag name / http request param: monkeyTeamAlpha.monkeyWorkers[0].salary saved to the MonkeyBean object within an ArrayList monkeyList within a MonkeyTeamBean within the formbean? I know JSP will automatically save parameters to a javabean with the correctly named getters and setters, but there's obviously a gap in my knowledge because all my attempts to recreate the situation above have failed. I'll go off and try to find something in Sun's JSP specification, but if anyone can give me a clue, I'd be massively grateful. Thanks Adam [EMAIL PROTECTED] schrieb am 12.06.2002, 15:15:30: Hi All, I am trying to save a list created with the nested:iterate tag (from an object array in my form bean). I've written my code by following the SaveMonkey example from Arron Bates' KeyboardMonkey site (kudos to you, capt'n) - but the object array doesn't get recreated on a submit! Can I use a nested:iterate tag on an array straight out of the form bean? That seems to be the only difference I can see between mine and the SaveMonkey demo. The setList(Object[] newList) isn't working. Struts or Tomcat isn't recognising it as a normal javabean property setter I guess. Here's what the HTML looks like: Should I keep looking for a bug that's stopping the setList() method from being recognised as a setter method? Thanks if you can help, Adam -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Problem with maintaining a database connection in a session bean
Connections are not serializable (to my knowledge) and may through a NotSerializableException when you put the information into the session. This might be closing your connection. --- Ted Husted [EMAIL PROTECTED] wrote: A better place to post a message like this is the USER list where there are more people to help you. Though, this strategy is not directly related to Struts. You might want to check other resources, like JSP-Interest and JGuru. http://archives.java.sun.com/jsp-interest.html http://www.jguru.com/faq/home.jsp?topic=JSP -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services Georges wrote: Hi, I'm trying to build a small pilot application with Struts. My ultimate goal is a dynamic web application with intensive use of database. My database is Oracle 8. The problem is following: in 'LoginAction' I set up a database connection (java.sql.Connection variable) with Oracle database. I save it in the User session bean as a bean-variable. Then I test it in a jsp-page. Everything seems to work: the variable containing the database connection is created and put into User bean (something like ...setConnection(connection)). The first time the jsp-page works well: the connection comes from conn=user.get_connection(), I can send a select-query to the database and display the outcome etc. But if I refresh the jsp-page, then at a certain moment an error message is displayed: java.sql.SQLException: Closed Connection I undestand that the connection gets somehow lost in the session bean. This happens especially when I test with two parallel sessions (one from IE and another from Netscape). Can anyone help me? Where could the connection go lost? Thanks, George. P.S I have to save a connection with every session because this way I can get user info from the database and administer database privileges. I can't use just a connection pool and get a connection from there every time I need something from the database. I have to lock records, maintain transactions etc., so every user/session needs to have an individual database connection. - Teatri- , kino- ja kontserdipiletid nüüd hiirekliki kaugusel! http://www.hot.ee -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Problem with PropertyUtils.copyProperties(...
I am using a DynaActionForm: form-bean name=userForm dynamic=true type=org.apache.struts.validator.DynaValidatorForm form-property name=id type=java.lang.String/ form-property name=firstName type=java.lang.String/ form-property name=lastName type=java.lang.String/ form-property name=dispatch type=java.lang.String/ /form-bean I want to perform the following in my action: DynaActionForm f = (DynaActionForm)form; User user = new User(); try{ PropertyUtils.copyProperties(user, f); } catch(Exception e){...} My user object is composed as follows: package ob.users; public class UserDTO { private String firstName; private String lastName; private Integer id; public java.lang.String getFirstName() { return firstName; } public Integer getId() { return id; } public java.lang.String getLastName() { return lastName; } public void setFirstName(java.lang.String value) { firstName = value; } public void setId(Integer value) { id = value; } public void setLastName(java.lang.String value) { lastName = value; } } And I keep on getting Error creating DTO -- java.lang.NoSuchMethodException: Unknown property 'class' I am relatively new using the bean utils package and I didn't find anything in the archives. Can anyone tell me what I'm doing wrong. Thanks in advance ** Juan Alvarado Internet Developer -- Manduca Management (786)552-0504 [EMAIL PROTECTED] AOL Instant Messenger: [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Running Multiple applications--- Help needed
Hi All need some help within my webapps directory i need to have multiple applications directories. with different configuration xml files(this is a database conf file)I need to put the respective xml files within the applications directories So what changes i need to do in my code to point to the directory i have put the xml file. I have tried things lik String location = ..\\webapps\\Dynapro\\web-inf\\conf\\dbconfig.xml; but it always looks into the bin directory and gives an error of in processesaccess.java java.io.FileNotFoundException: C:\Program Files\Apache Tomcat 4.0\bin\processes.xml (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(FileInputStream.java:64) at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:6 9) can anyone pls help? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Running Multiple applications--- Help needed
Can you cut paste the code you use to do the file lookup? Susmita Pati [EMAIL PROTECTED] on 06/12/2002 11:28:34 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc:(bcc: Kevin Bedell/Systems/USHO/SunLife) Subject: Running Multiple applications--- Help needed Hi All need some help within my webapps directory i need to have multiple applications directories. with different configuration xml files(this is a database conf file)I need to put the respective xml files within the applications directories So what changes i need to do in my code to point to the directory i have put the xml file. I have tried things lik String location = ..\\webapps\\Dynapro\\web-inf\\conf\\dbconfig.xml; but it always looks into the bin directory and gives an error of in processesaccess.java java.io.FileNotFoundException: C:\Program Files\Apache Tomcat 4.0\bin\processes.xml (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(FileInputStream.java:64) at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:6 9) can anyone pls help? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tilesPlugin, tiles struts subapps
Subject: Re: tilesPlugin, tiles struts subapps From: Torgeir Veimo [EMAIL PROTECTED] === Torgeir Veimo wrote: To answer myself I implemented the init() method in the TilesPlugin, like this; Ok, works allmost, in that I can use actions in the subapp fine within definitions, definition name=article.tabs.body page=/articleLayout.jsp put name=selectedIndex value=0/ put name=parameterName value=selected/ putList name=tabList item value=content link=/article.do classtype=org.apache.struts.tiles.beans.SimpleMenuItem / item value=searchimages link=/searchimages.do classtype=org.apache.struts.tiles.beans.SimpleMenuItem/ item value=searchusers link=/searchuser.do classtype=org.apache.struts.tiles.beans.SimpleMenuItem/ /putList /definition the article.do action works, but when it load the articleContent.jsp page defined by action path=/article type=com.ecomda.publishing.form.ArticleAction name=articleForm validate=false scope=session forward name=view path=/articleContent.jsp/ /action Then the reference back to the article.do action in the jsp file is not found; html:form action=/article.do So this is actually the last link. Anyone know where I can look to complete this stuff? Actually, is the tiles stuff being developed to support subapplications properly currently at all? -- -Torgeir -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: User Authentication
On Wed, 12 Jun 2002, Struts Newsgroup wrote: Date: Wed, 12 Jun 2002 05:10:01 -0700 From: Struts Newsgroup [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: User Authentication Subject: Re: User Authentication From: David Bolsover [EMAIL PROTECTED] === Hi all I am pleased that my posting provoked so may interesting responses; I was particularly intrigued by the reference to Open Symphony - OSUser module - thanks to Kevin Palfreyman for that. Sadly, since Open Symphony - OSUser module is still under developement, it does not solve my present need. There were several references to the 'roles' model - which I already use in the application I'm developing; indeed, it would be difficult without using roles. I do not want to have to define new roles for each new user and his particular access privileges - it is just too difficult to manage. For a container-specific implementation of user management (and full support for container managed security), check out the administration tool in the recent Tomcat 4.1.3 beta release. It lets you create new users, roles, and groups (members of a group inherit all the roles assigned to the group), which become immediately available for new logins. Out of the box, it manages the tomcat-users.xml file that is Tomcat's default user database, but it's accessed via a DAO interface that can be implemented in other ways (against a database, against a directory server, etc.) as well. And the admin app is Struts based ... ;-) Even if you can't use this directly for your application, the implementation (since it is open source) might give you some ideas for how to approach your own user management. I will follow up on the OSUser module link and post back to the group when I have more information. David Bolsover Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts Tag to stop caching of pages on a proxy server
What is a struts tag to replace this. I don't want to put this scriptlet in my page. % response.setHeader(Cache-Control,no-cache); //HTTP 1.1 response.setHeader(Pragma,no-cache); //HTTP 1.0 response.setDateHeader (Expires, 0); //prevents caching at the proxy server % _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Digester rule(s) to reference outer tags
On Tue, 11 Jun 2002, Struts Newsgroup wrote: Date: Tue, 11 Jun 2002 03:10:02 -0700 From: Struts Newsgroup [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Digester rule(s) to reference outer tags Subject: Digester rule(s) to reference outer tags From: Florian Georg [EMAIL PROTECTED] === Hi, I want to use the Struts Digester to parse an document like this : users user name=foo role name=user / /user user name=bar role name=user / role name=admin / /user /users roles role name=user descriptionUser role/description /role role name=admin descriptionAdministrator role/description /role /roles So the problem is, I want to re-use (or better : reference) the defined roles in an completely independend branch of the hierarchy, given the name of the role. I thought it's similar to the form-bean name=baz and action type=baz - rule in the struts-config.xml, so I looked at the struts sources... but I just didn't get it :-( The trick that Struts uses for this is to have an outer object on the evaluation stack, with both addUser() and addRole() methods on it. In Struts 1.0, the outer object is the ActionServlet instance itself - in Struts 1.1, it is the ApplicationConfig object. Thus, for Struts 1.0, you'll see the following rules (extracted from the complete set) that deal with independent hierarchies of form-bean and action elements: digester.addObjectCreate(struts-config/form-beans/form-bean, formBeanClass, className); ... digester.addSetNext(struts-config/form-beans/form-bean, addFormBean, org.apache.struts.action.ActionFormBean); digester.addObjectCreate(struts-config/action-mappings/action, mappingClass, className); ... digester.addSetNext(struts-config/action-mappings/action, addMapping, org.apache.struts.action.ActionMapping); Now, when the digester is actually executed, ActionServlet calls: digester.push(this); ... digester.parse(...); so that the this object (i.e. ActionServlet itself) onto the evaluation stack first. Now, for each form-bean element, addFormBean() gets called on the ActionServlet instance. Likewise, for each action element, a call to addMapping() is performed. The outer object maintains the two collections independently. Can anyone give me a hint ? thanks in advance Florian Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: deploying in jboss 3
On Tue, 11 Jun 2002, Gary Struthers wrote: Date: Tue, 11 Jun 2002 18:01:58 -0700 From: Gary Struthers [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: deploying in jboss 3 James Ward wrote: I am actually using 1.1B1, but It shouldn't make a difference. When you are running the example wars that come with struts make sure you do NOT have the struts.jar anywhere in JBoss's classloader (ie. deploy or any lib dirs). This will mess things up. -James Why will it mess things up? JBoss 3 has a unified class loader which is meant to solve problems caused by classes being differentiated by their class loader. This *definitely* matters ... Tomcat 4 has the same multi-class-loader architecture, and you'll experience the same sorts of issues. If you're using Struts 1.0.x, you can pretty much guarantee that you will have class not found issues if struts.jar is in a shared class loader. Struts 1.1b1 has changes that should address this, so it should work. The basic problem is that classes loaded from a parent (shared) class loader cannot directly see any classes loaded from your webapp class loader (i.e. /WEB-INF/classes and /WEB-INF/lib). So, for example, if the Struts ActionServlet was loaded from the parent, and your form bean class is defined in /WEB-INF/classes, Struts will have problems when it tries to execute: Class formBeanClass = this.getClass().getClassLoader().loadClass(formBeanClassName); In Struts 1.1, the workaround is based upon a promise by the container to supply a reference to the webapp class loader that can be accessed by shared classes. This promise is a requirement in Servlet 2.3, but is widely implemented on Servlet 2.2 containers -- and makes the following code work, even in the scenario we are talking about here: WebappClassLoader cl = Thread.currentThread().getContextClassLoader(); Class formBeanClass = cl.loadClass(formBeanClassName); Gary Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: workflow example explaination.
On Wed, 12 Jun 2002, Anjali Jain wrote: Date: Wed, 12 Jun 2002 14:37:15 +0530 From: Anjali Jain [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: workflow example explaination. Hi All, can anybody explain me the foll struts-config.xml...?? Especially set-property tag supposed to do ...?? I've picked up this file from struts workflow example. The set-property tag is a general way to set JavaBeans properties on an underlying implementation class, even though the property name is not defined as a valid element in the DTD. !-- Display login -- action path=/displayLoginAction type=com.livinglogic.struts.workflow.SuccessAction set-property property=primaryWorkflow value=login / set-property property=newState value=1 / set-property property=nextState value=2 / forward name=success path=/login.jspp / /action This logic assumes that the SuccessAction class has public setter methods setPrimaryWorkflow(), setNewState(), and setNextState() -- you can still configure them in struts-config.xml even though these property names are not allowed on the action element itself. Many of the Struts elements allow set-property tags to be nested inside -- check out the Struts DTD for more information. Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Struts Tag to stop caching of pages on a proxy server
At 10:49 AM -0500 2002/06/12, Chris Hardin wrote: What is a struts tag to replace this. I don't want to put this scriptlet in my page. There's no tag, but there's an controller parameter, nocache. In Struts 1.1 you set it in the struts-config.xml file for the specific sub app (see http://jakarta.apache.org/struts/api/org/apache/struts/config/ControllerConfig.html) and In Struts 1.0 you set the nocache init parameter for the ActionServlet (in web.xml). Hope that helps Joe % response.setHeader(Cache-Control,no-cache); //HTTP 1.1 response.setHeader(Pragma,no-cache); //HTTP 1.0 response.setDateHeader (Expires, 0); //prevents caching at the proxy server % _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- -- * Joe Germuska{ [EMAIL PROTECTED] } It's pitiful, sometimes, if they've got it bad. Their eyes get glazed, they go white, their hands tremble As I watch them I often feel that a dope peddler is a gentleman compared with the man who sells records. --Sam Goody, 1956 tune in posse radio: http://www.live365.com/stations/289268 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Using redirect=true with tiles component
Hello, You can't use redirect=true with a tiles definition's name. Tiles definition's names are logical names, not URL, so it is not possible to redirect to a definition name. In the same way, it is not possible to use directly a definition name in a link. Hope this help, Cedric [EMAIL PROTECTED] wrote: I have the following entry in my config action path=/login type=com.ffic.training.LoginAction name=logonForm scope=session input=/Login.jsp forward name=success path=welcome.page redirect=true/ /action My tiles definition xml is as follows definition name=welcome.page path=/TilesTemplate.jsp put name=menu content=/Menu.jsp/ put name=body content=/WelcomeContent.jsp/ /definition Without the redirect=true, everything works fine, but when I use it, I get the following error Error 404 An error has occured while processing request:http://localhost:8080/app/welcome.page Message: File not found: //welcome.page If I change the path to a regular jsp path (ie path=/Welcome.jsp) things work fine. Can anyone help me on this? Thanks in advance. ** Please Note: The information in this E-mail message, and any files transmitted with it, is confidential and may be legally privileged. It is intended only for the use of the individual(s) named above. If you are the intended recipient, be aware that your use of any confidential or personal information may be restricted by state and federal privacy laws. If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this E-mail message. If you have received this E-mail in error, please notify the sender and delete the material from any computer. Thank you. ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: forward to a tile definition.........
In http://www.lifl.fr/~dumoulin/tiles/doc/installation.html. I have to admit that is not so well explained. A simple installation guide with Struts1.1 is missing. Cedric Trieu, Danny wrote: do you know where in the tiles distribution that Cedric talk about this? -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 10:54 AM To: Struts Users Mailing List Subject: Re: forward to a tile definition. Do you have the following entry in your struts-config.xml? !-- Tiles -- controller processorClass=org.apache.struts.tiles.TilesRequestProcessor / Trieu, Danny [EMAIL PROTECTED] on 06/03/2002 10:45:10 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] cc: Subject: forward to a tile definition. Hi all, Does anyone know why ActionForward can't find my Tiles' definition? When I used:forward name=success path=my.tile.definition.page / it is giving me the HTTP 500 Internal server error. I guess it couldn't find my definition or doesn't have a clue what path is. But if I create a test.jsp, and have the definition inserted, the it works.. I have my action servlet set to use servlet-nameaction/servlet-name servlet-classorg.apache.struts.tiles.ActionComponentServlet/servlet-cla ss I am using Struts1.1 with Weblogic 6.1sp2 Thanks, Danny -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ** Please Note: The information in this E-mail message, and any files transmitted with it, is confidential and may be legally privileged. It is intended only for the use of the individual(s) named above. If you are the intended recipient, be aware that your use of any confidential or personal information may be restricted by state and federal privacy laws. If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this E-mail message. If you have received this E-mail in error, please notify the sender and delete the material from any computer. Thank you. ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tiles and putList
Hello, Actually, definitions are used to associate a layout (page=aLayout.jsp) and some attributes. Attributes are parameters provided to layout. The Layout can use its provided attributes as it wants. What you are trying to do is to use a definition to define a List. Of course this doesn't work. A solution is to create a small Tiles that you associate to your definition blueTheme. This Tiles do the style type ... tag using the provided list. Hope this help, Cedric Struts Newsgroup (@Basebeans.com) wrote: Subject: Tiles and putList From: Matt Raible [EMAIL PROTECTED] === I have the following definition: definition name=pageLayout path=/layouts/pageLayout.jsp putList name=screenStyles add value=/styles/page.css/ add value=/styles/bluegray.css/ /putList /definition Then in my pageLayout.jsp, I use the following to print out the stylesheets associated with a page: style type=text/css media=screen tiles:useAttribute id=screenList name=screenStyles classname=java.util.List / c:forEach var=stylesheet items=${screenList} @import url(%=request.getContextPath()%c:out value=${stylesheet}/); /c:forEach /style This all works great. The enhancement I want to make is to define the different putList's so I can have blueTheme and orangeTheme as a definition. The reason is thus - if I want to override the list of stylesheets in a page that extends pageLayout, I have to add the full list again, thusly: definition name=page.tools extends=pageLayout put name=title.key value=tools.title/ put name=heading.key value=tools.heading/ put name=content value=/viewer/tools.jsp/ putList name=screenStyles add value=/styles/page.css/ add value=/styles/orangegray.css/ /putList /definition I'd like to have the following: definition name=blueTheme putList name=screenStyles add value=/styles/page.css/ add value=/styles/bluegray.css/ /putList /definition and then I could just change the page.tools definition to: definition name=page.tools extends=pageLayout put name=title.key value=tools.title/ put name=heading.key value=tools.heading/ put name=content value=/viewer/tools.jsp/ put name=screenStyles value=blueTheme/ /definition However, this doesn't work. I'd tell you my error - but since my errorPage extends pageLayout - I end up in an infinite loop :( Thanks, Matt -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tiles and session bean org.apache.struts.action.LOCALE strange !
Hello, Let follow your page and tiles are processed : * You browse your page url /test.jsp * The page is processed o The insert tag is encountered, its attributes are processed + the bean:message key=... tag is processed + the logic tag is processed o The insert tag insert requested layout + the layout tags are processed, so the html:html locale=true So, the local is set into session only after you check it ! It is why you have such behavior. Usually, you pass the key to your inserted tiles, and only in the inserted tiles you retrieve the value for the key. Hope this help, Cedric [EMAIL PROTECTED] wrote: Hi all, I have troubles accessing the org.apache.struts.action.LOCALE session bean using tiles. I wrote a simple example to reproduce my problem : My template (/templates/test_templates.jsp) is : %@ page language='java' % %@ taglib uri=/WEB-INF/tiles.tld prefix=template % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html:html locale=true head/head body template:get name='title'/ /body /html:html Important to notice is that the attribute locale=true at html:hml... forces the creation of a locale in the user's session (if one was not present). Now my jsp page (/test.jsp) will try to see if the locale bean is present and also use the locale bean by calling bean:message... which will use the locale to get the right resource bundle : %@ page language='java' % %@ taglib uri=/WEB-INF/tiles.tld prefix=template % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % template:insert template='/templates/test_template.jsp' template:put name='title' type='string'bean:message key=index.title/ logic:notPresent name=org.apache.struts.action.LOCALE scope=session No locale !!! /logic:notPresent /template:put /template:insert Third essential type of files are the resource bundles : I have three different ones, each with there own index.title=... line. When I run all this, my application gives me that there is no locale present, BUT it does provide me with a string for index.title (not the right one - see below). When I run the example without tiles (simply do tiles' job manually) : %@ page language='java' % %@ taglib uri=/WEB-INF/tiles.tld prefix=template % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % html:html locale=true head/head body bean:message key=index.title/ logic:notPresent name=org.apache.struts.action.LOCALE scope=session No locale !!! /logic:notPresent /body /html:html I don't get the error message that there is no locale AND I get a different string for index.title than I got with Tiles (this is the default language one I expected) I suppose Tiles doesn't get the right session bean... Can anyone explain this strange behavior ? Thanks ! Kristof Pelckmans Consultant Unisys Hallepoortlaan 41-58 - 1060 Brussel IT 219 Sectie 13/4 Bureau 4de verdieping - B022 E-Mail NMBS : [EMAIL PROTECTED] E-Mail UNISYS : [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Parameterizing an html:img in a template
You can use the native html tags instead of the struts one : img src=template:get name='imageFile'/ / Hope this help, Cedric Struts Newsgroup (@Basebeans.com) wrote: Subject: Parameterizing an html:img in a template From: Eric Rizzo [EMAIL PROTECTED] === Tried searching the list/newsgroup archive for this issue, but only found reference to http://www.mail-archive.com/struts-user@jakarta.apache.org/msg31204.html which mentions You can't nest a tag inside another tag in jsp (which I already know). Please forgive and point if this has already been addressed. I want to define a template JSP that expects as one of its content parameters the name of an image to include. What I'd like to do is something like: foo.jsp: %@ taglib uri=struts-html.tld prefix=html % %@ taglib uri=struts-template.tld prefix=template % html:img page=template:get name='imageFile'/ / and then use the template like: template:insert template=foo.jsp template:put name=imageFile content=foo.jpg direct=true/ /template:insert But of course this won't work because you can't use the result of one JSP tag as the value for an attribute of another JSP tag. Is there another way I can paramterize the image(s) my template uses? Tiles is not an option for me at this point, but if there is not other way how would I set up tiles definitions to accomplish the same thing (example would be nice)? TIA, Eric -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tile config using tileplugin?
Hello, Tiles plugin is not available yet. I have started to implement it, but haven't finalize it. It is an error that it appear in the distribution ;-(. Certainly a commit done late in the night ... Before releasing it, I have to decide on a coherent scheme for Tiles factory : * one factory for each subapps or one for all subapps ? * do we automatically prefix definition names with subapps name ? * How do we deal with default subapps ? * How can we refer to definitions common to all subapps ? Struts Newsgroup (@Basebeans.com) wrote: Subject: tile config using tileplugin? From: Torgeir Veimo [EMAIL PROTECTED] === I tried using plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitionsConfig value=/WEB-INF/tileDefinitions.xml/ /plug-in in my struct-config.xml instead of in the web.xml file, but it doesn't work. I get a message Servlet action is currently unavailable description The requested service (Servlet action is currently unavailable) is not currently available. Should it work this way? I would like to do this because I have several sub applications, and would like to use one tileDefinitions.xml file for each, and I don't know about them all in advance (Hence I cannot put the all in web.xml initially). -- -Torgeir -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tilesPlugin, tiles struts subapps
Hello, The Tiles plugin is normally not available yet ;-(. It is an error that it already appears in the distribution. To use Tiles with Struts1.1, you should use the TilesRequestProcessor and ComponentActionServlet. The first one catch Struts forwards, and the last one do all the initialization stuff. In the future, the plugin will do installation stuff. But I need to provide a consistent behavior. Any help is welcome ... Cedric Struts Newsgroup (@Basebeans.com) wrote: Subject: tilesPlugin, tiles struts subapps From: Torgeir Veimo [EMAIL PROTECTED] === I have a subapp in which I would like to use tiles. I allready use tiles in the main struts application. I specify requestprocessor and tilesPlugin like this; (With tiles 1.1dev) controller processorClass=org.apache.struts.tiles.TilesRequestProcessor / message-resources parameter=PublishingApplicationResources null=false / plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitionsConfig value=publishing-tileDefinitions.xml/ /plug-in However, the requestprocessor for this subapp seems to look for definitions in the main applications tileDefinitions.xml file. Is there something missing in the implementation that currently prevents such a scenario from working? My main application also specify the definition using the tilesPlugin, not in web.xml. Also, should I expect definitions in the subapp being available to the main app by prefixing the subapp name to the definition name in a jsp, like this; main.jsp; tiles:insert definition=publishing/article.tabs.body / (or /publishing...)? The documentation is a bit scarse on using tiles in subapps with multiple config... -- -Torgeir -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: some PDF stuff
Generating a PDF report from struts action class using 'iText' works fine. But We have a small issue related with Struts. When there is a validation error, The errors display on the input page. So we enter required data, and click 'Generate PDF report', Opens up Acrobat reader with the report. In this case how can we clear the errors on the input page? Right now, the error message still displays even after I open report. (We don't want to open PDF in the same browser window, So we used content-disposition as 'attachment'). Is there any way to refresh the input page, once the response is submitted. Thanks, Vip. -Original Message- From: Vincent Aumont [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 7:45 PM To: Struts Users Mailing List Subject: Re: some PDF stuff response.setHeader(Content-disposition,attachment; filename= + filename); I don't have a file name for the pdf I generate (may be I can have one). Any name will do. It's the name the browser uses should your user decide to save the document to disk. The Action class returns a NULL Action Forward. Same here. -Vincent. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Running Multiple applications--- Help needed
The Struts sample application provides a good example of doing this. Though you're using JaxP and it uses the Digester for processing the XML. From the file: org.apache.struts.webapp.example.DatabaseServlet.java - The definition of a path to the xml file: /** * The resource path of our persistent database storage file. */ private String pathname = /WEB-INF/database.xml; - The code that reads it in - though it uses a BufferedInputStrream and you're using a File. // Acquire an input stream to our database file InputStream is = getServletContext().getResourceAsStream(pathname); if (is == null) { log(No such resource available - loading empty database); return; } BufferedInputStream bis = new BufferedInputStream(is); So, given all this it looks as if you should be able to change your code below to something like: String pathname = /WEB-INF/conf/dbconfig.xml; DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder parser = docBuilderFactory.newDocumentBuilder(); InputStream is = getServletContext().getResourceAsStream(pathname); doc = parser.parse( is ); the parse() method of the DocumentBuilder in Jaxp is overloaded to allow you to submit a File OR and InputStream and have it work. Make sure that you capitalize WEB-INF - I believe it is case-sensitive. Best of luck, Kevin Susmita Pati [EMAIL PROTECTED] on 06/12/2002 12:01:56 PM To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] cc: Subject: Sorry didnt read ur msg carefully public class DatabaseAccess { private static DataBaseForm data = null; private static DatabaseAccess databaseAccess = null; private final StringDB_DRIVER = driver; private final StringDB_URL =url; private final StringDB_USER =user; private final StringDB_PASSWORD = password; private DatabaseAccess() {} public static DatabaseAccess getInstance() { if(databaseAccess == null) { databaseAccess = new DatabaseAccess(); } return databaseAccess; } private static Element loadDocument() { Element root = null; try { Document doc = null; // String location = dbconfig.xml; String location = ..\\webapps\\Dynapro\\web-inf\\conf\\dbconfig.xml; DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder parser = docBuilderFactory.newDocumentBuilder(); doc = parser.parse(new File(location)); root = doc.getDocumentElement(); } catch (SAXParseException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (java.io.IOException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return root; } private String getData(Element root, String elementType) { String elementData = ; Nodechild = null; NodeListlist = root.getElementsByTagName(elementType); for (int loop = 0; loop list.getLength(); loop++) { Node node = list.item(loop); if (node != null) { NodeListchildren = node.getChildNodes(); for (int innerLoop = 0; innerLoop children.getLength(); innerLoop++) { child = children.item(innerLoop); } } } return child.getNodeValue(); } public DataBaseForm getDBData() { if (data == null) { Element root = loadDocument(); String db_driver = getData(root, DB_DRIVER); String db_url = getData(root, DB_URL); String db_user = getData(root, DB_USER); String db_password = getData(root, DB_PASSWORD); data = new DataBaseForm(db_driver,db_url,db_user,db_password); } return data; } } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 11:43 AM To: Susmita Pati Subject: RE: Running Multiple applications--- Help needed Hmm... I read the exception trace in the original post. Can you post THE CODE THAT GENERATES THIS EXCEPTION. I can certainly verify from what you've sent that you: 1. Correctly create a String variable called location, and 2. throw an exception when attempting to access a file using some as-yet-unseen code. It looks from the info below that your java file is called processesaccess.java. Can you post its contents including the lines between where you create the String location variable and where you attempt to access the xml file? Susmita Pati [EMAIL PROTECTED] on 06/12/2002 11:50:42 AM To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] cc: Subject: in processesaccess.java java.io.FileNotFoundException: C:\Program Files\Apache Tomcat 4.0\bin\processes.xml (The system cannot
Re: could anyone suggest an example to use tabs in a strutsapplication
There is an example of tabs shipped with Tiles. * The tabs layout is defined in a separate jsp page. * Each tabs content is a jsp page. * You easily specify which contents should be added to your tabs in a definition : !-- body using tabs -- definition name=examples.tabs.body path=/layouts/tabsLayout.jsp put name=selectedIndex value=0 / put name=parameterName value=selected / putList name=tabList item value=Doc Home link=/index.jsp / item value=Quick overview link=/doc/quickOverview.jsp / item value=Tutorial link=/doc/tutorial.jsp / item value=Examples Home link=/examples/index.jsp / /putList /definition Feel free to use it or improve it. Cedric Akash Munjal wrote: hi, Could anyone suggest any working examples/tips on how to go about using tabs in a struts application. What is the best way to carry out the UI design using tabs. thanks, akash. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Please help with simple problem
Hi, 1.I have a Struts action class, LoginAction which extends Action. 2.I set an attribute on the request inside the perform method like this: request.setAttribute(test, sometxt); 3.The success mapping goes to a jsp page which consists of frames. 4.I am trying to access this request attribute in one of the frame jsps but when I use jsp scripting to list the request attributes, there is no test in the list! If I store the same in the session as an attribute, I can access it through 'request.getSession().getAttribute(test);'. My LoginAction class is defined with a formbean in session scope but as far as I know this should have nothing to do with manually storing and retrieving request attributes. Any clues? Thanks Jim __ ?xml:namespace prefix = o ns = urn:schemas-microsoft-com:office:office / Jim Clayson Infogain Limited tel: 01628 580600 fax: 01628 580610 email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] web: www.infogain.com http://www.infogain.com/ Disclaimer: Neither this e-mail nor any attachment places any legal or contractual obligations on Infogain Limited. Any reproduction, disclosure or dissemination beyond the intended addressees is strictly prohibited save for the legitimate business purposes of Infogain Limited and its clients or partners. __
Re: multiple applications
Thanks Craig, so, I just wonder how to link from a JSP belonging to a sub-application to a JSP in the default one. - I have not problems in linking from the default one to a subapplication, by example, using: in a JSP belonging to default app, I place this link: html:link page=/segundaapp/index.doEntrada/html:link As context_path + sub-application_prefix = context_path, since sub-application_prefix=, I can add the sub-application_prefix to my URL to point the intended sub-aplication. - However, in a link from a sub-application the base URL is context_path + sub-application_prefix, so any link from there would be referred to the same sub-application. Adolfo. From: Craig R. McClanahan [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: multiple applications Date: Tue, 11 Jun 2002 13:13:17 -0700 (PDT) On Tue, 11 Jun 2002, Adolfo Miguelez wrote: Date: Tue, 11 Jun 2002 10:39:40 + From: Adolfo Miguelez [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: multiple applications As a addendum, I would like to say, that I have browsed the future struts book, but I can not find accurate documentation about JSP links and struts-config definition for the paths in the subapplications. In a sub-application, the paths to JSP pages (such as in a forward) are evaluated as relative to the context path + sub-application prefix, instead of just the context path. The basic philosophy is that you should be able to use the same struts-config.xml file, with zero changes, as either the default subapp or a subapp attached to a prefix. I think would be interesting to include a more detailed example, further definition in web.xml of the new struts-config. Regards, Adolfo. Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] HTML HEAD TITLEAdolfo's signature/TITLE /HEAD BODY centerbemAdolfo Rodriguez Miguelez/emb/center /BODY /HTML _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Please help with simple problem
Yeah, I guess, you are sending your request attribute to the frameset. This frameset, in turn, mades new requests to load its frames, but these new responses do not contain the attribute, since atribute is sended only to the first response. I run in the same problem awhile ago. Adolfo. From: Jim Clayson [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject: Please help with simple problem Date: Wed, 12 Jun 2002 18:06:52 +0100 Hi, 1.I have a Struts action class, LoginAction which extends Action. 2.I set an attribute on the request inside the perform method like this: request.setAttribute(test, sometxt); 3.The success mapping goes to a jsp page which consists of frames. 4.I am trying to access this request attribute in one of the frame jsps but when I use jsp scripting to list the request attributes, there is no test in the list! If I store the same in the session as an attribute, I can access it through 'request.getSession().getAttribute(test);'. My LoginAction class is defined with a formbean in session scope but as far as I know this should have nothing to do with manually storing and retrieving request attributes. Any clues? Thanks Jim __ ?xml:namespace prefix = o ns = urn:schemas-microsoft-com:office:office / Jim Clayson Infogain Limited tel: 01628 580600 fax: 01628 580610 email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] web: www.infogain.com http://www.infogain.com/ Disclaimer: Neither this e-mail nor any attachment places any legal or contractual obligations on Infogain Limited. Any reproduction, disclosure or dissemination beyond the intended addressees is strictly prohibited save for the legitimate business purposes of Infogain Limited and its clients or partners. __ HTML HEAD TITLEAdolfo's signature/TITLE /HEAD BODY centerbemAdolfo Rodriguez Miguelez/emb/center /BODY /HTML _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Problem with PropertyUtils.copyProperties(...
Juan, I think I made a mistake (sort of) when I shared some of this code. I didn't realize you don't need the dispatch field (or whatever you want to name it) in the actual DynaActionForm or an ActionForm. I notice that the UserDTO doesn't have the dispatch member in it, so maybe the PropertyUtils is looking for to convert that field from the DynaActionForm? (Not sure though just a guess since I haven't used PropertyUtils ). Try just removing the form-property name=dispatch type=java.lang.String/ from the DyanActionForm and see what happens. Rick On Wednesday, June 12, 2002, 11:15:40 AM, Juan wrote: JASL I am using a DynaActionForm: form-bean name=userForm JASL dynamic=true JASL type=org.apache.struts.validator.DynaValidatorForm JASL form-property name=id type=java.lang.String/ JASL form-property name=firstName type=java.lang.String/ JASL form-property name=lastName type=java.lang.String/ JASL form-property name=dispatch type=java.lang.String/ JASL /form-bean JASL I want to perform the following in my action: JASL DynaActionForm f = (DynaActionForm)form; JASLUser user = new User(); JASL try{ JASL PropertyUtils.copyProperties(user, f); JASL } JASL catch(Exception e){...} JASL My user object is composed as follows: JASL package ob.users; JASL public class UserDTO { JASL private String firstName; JASL private String lastName; JASL private Integer id; JASL public java.lang.String getFirstName() { JASL return firstName; JASL } JASL public Integer getId() { JASL return id; JASL } JASL public java.lang.String getLastName() { JASL return lastName; JASL } JASL public void setFirstName(java.lang.String value) { JASL firstName = value; JASL } JASL public void setId(Integer value) { JASL id = value; JASL } JASL public void setLastName(java.lang.String value) { JASL lastName = value; JASL } JASL } JASL And I keep on getting Error creating DTO -- java.lang.NoSuchMethodException: JASL Unknown property 'class' JASL I am relatively new using the bean utils package and I didn't find anything JASL in the archives. Can anyone tell me what I'm doing wrong. JASL Thanks in advance JASL ** JASL Juan Alvarado JASL Internet Developer -- Manduca Management JASL (786)552-0504 JASL [EMAIL PROTECTED] JASL AOL Instant Messenger: [EMAIL PROTECTED] JASL -- JASL To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] JASL For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Rick mailto:[EMAIL PROTECTED] I wish I had a dollar for every time I spent a dollar, because then, Yahoo!, I'd have all my money back. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Please help with simple problem
The original request goes out of scope when you load the frameset (the success mapping). Each of the subsequent frames is loaded with a new request. You'll have to pass it in the session. If that feels like you're polluting the session, you can use removeAttribute in a JSP... Joe At 6:06 PM +0100 2002/06/12, Jim Clayson wrote: Hi, 1.I have a Struts action class, LoginAction which extends Action. 2.I set an attribute on the request inside the perform method like this: request.setAttribute(test, sometxt); 3.The success mapping goes to a jsp page which consists of frames. 4.I am trying to access this request attribute in one of the frame jsps but when I use jsp scripting to list the request attributes, there is no test in the list! If I store the same in the session as an attribute, I can access it through 'request.getSession().getAttribute(test);'. My LoginAction class is defined with a formbean in session scope but as far as I know this should have nothing to do with manually storing and retrieving request attributes. Any clues? Thanks Jim -- -- * Joe Germuska{ [EMAIL PROTECTED] } It's pitiful, sometimes, if they've got it bad. Their eyes get glazed, they go white, their hands tremble As I watch them I often feel that a dope peddler is a gentleman compared with the man who sells records. --Sam Goody, 1956 tune in posse radio: http://www.live365.com/stations/289268 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: multiple applications
On Wed, 12 Jun 2002, Adolfo Miguelez wrote: Date: Wed, 12 Jun 2002 17:00:02 + From: Adolfo Miguelez [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: multiple applications Thanks Craig, so, I just wonder how to link from a JSP belonging to a sub-application to a JSP in the default one. - I have not problems in linking from the default one to a subapplication, by example, using: in a JSP belonging to default app, I place this link: html:link page=/segundaapp/index.doEntrada/html:link As context_path + sub-application_prefix = context_path, since sub-application_prefix=, I can add the sub-application_prefix to my URL to point the intended sub-aplication. - However, in a link from a sub-application the base URL is context_path + sub-application_prefix, so any link from there would be referred to the same sub-application. Switching subapps is surprisingly difficult :-) Actually, it's not really that hard -- there is a new standard action (org.apache.struts.actions.SwitchAction) that is designed expressly for this purpose. Simply route your hyperlinks through this action, and use the specify the subapp prefix for the application you want to switch to. The page parameter specifies the application-relative resource within that page to forward to next. By the way, the prefix for the default subapp is a zero-length String (), just like the context path for the default context is . Adolfo. Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: forward to a tile definition.........
I did have some trouble getting tiles to work under 1.1, but the Advanced Tiles pdf draft on the web site for tiles was much help in getting it running correctly! Bill -Original Message- From: cedric.dumoulin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 12:17 PM To: struts-user Subject: Re: forward to a tile definition. In http://www.lifl.fr/~dumoulin/tiles/doc/installation.html. I have to admit that is not so well explained. A simple installation guide with Struts1.1 is missing. Cedric Trieu, Danny wrote: do you know where in the tiles distribution that Cedric talk about this? -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 10:54 AM To: Struts Users Mailing List Subject: Re: forward to a tile definition. Do you have the following entry in your struts-config.xml? !-- Tiles -- controller processorClass=org.apache.struts.tiles.TilesRequestProcessor / Trieu, Danny [EMAIL PROTECTED] on 06/03/2002 10:45:10 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] cc: Subject: forward to a tile definition. Hi all, Does anyone know why ActionForward can't find my Tiles' definition? When I used:forward name=success path=my.tile.definition.page / it is giving me the HTTP 500 Internal server error. I guess it couldn't find my definition or doesn't have a clue what path is. But if I create a test.jsp, and have the definition inserted, the it works.. I have my action servlet set to use servlet-nameaction/servlet-name servlet-classorg.apache.struts.tiles.ActionComponentServlet/servlet-c la ss I am using Struts1.1 with Weblogic 6.1sp2 Thanks, Danny -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ** Please Note: The information in this E-mail message, and any files transmitted with it, is confidential and may be legally privileged. It is intended only for the use of the individual(s) named above. If you are the intended recipient, be aware that your use of any confidential or personal information may be restricted by state and federal privacy laws. If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this E-mail message. If you have received this E-mail in error, please notify the sender and delete the material from any computer. Thank you. ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Issue with struts when generate reports from action class
Generating a PDF report from struts action class using 'iText' works fine. But We have a small issue related with Struts. When there is a validation error, The errors display on the input page. So we enter required data, and click 'Generate PDF report', Opens up Acrobat reader with the report. In this case how can we clear the errors on the input page? Right now, the error message still displays even after I open report. (We don't want to open PDF in the same browser window, So we used content-disposition as 'attachment'). Is there any way to refresh the input page, once the response is submitted. Thanks, Vip. -Original Message- From: Vincent Aumont [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 7:45 PM To: Struts Users Mailing List Subject: Re: some PDF stuff response.setHeader(Content-disposition,attachment; filename= + filename); I don't have a file name for the pdf I generate (may be I can have one). Any name will do. It's the name the browser uses should your user decide to save the document to disk. The Action class returns a NULL Action Forward. Same here. -Vincent. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Please help with simple problem
Thanks for that! Jim -Original Message- From: Joe Germuska [mailto:[EMAIL PROTECTED]] Sent: 12 June 2002 18:02 To: Struts Users Mailing List Subject: Re: Please help with simple problem The original request goes out of scope when you load the frameset (the success mapping). Each of the subsequent frames is loaded with a new request. You'll have to pass it in the session. If that feels like you're polluting the session, you can use removeAttribute in a JSP... Joe At 6:06 PM +0100 2002/06/12, Jim Clayson wrote: Hi, 1.I have a Struts action class, LoginAction which extends Action. 2.I set an attribute on the request inside the perform method like this: request.setAttribute(test, sometxt); 3.The success mapping goes to a jsp page which consists of frames. 4.I am trying to access this request attribute in one of the frame jsps but when I use jsp scripting to list the request attributes, there is no test in the list! If I store the same in the session as an attribute, I can access it through 'request.getSession().getAttribute(test);'. My LoginAction class is defined with a formbean in session scope but as far as I know this should have nothing to do with manually storing and retrieving request attributes. Any clues? Thanks Jim -- -- * Joe Germuska{ [EMAIL PROTECTED] } It's pitiful, sometimes, if they've got it bad. Their eyes get glazed, they go white, their hands tremble As I watch them I often feel that a dope peddler is a gentleman compared with the man who sells records. --Sam Goody, 1956 tune in posse radio: http://www.live365.com/stations/289268 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: deploying in jboss 3
Gary, When I have struts.jar in my deploy dir when trying to use the struts example apps, I get this error: javax.servlet.ServletException: Missing message for key index.title I found this message: http://www.mail-archive.com/struts-user@jakarta.apache.org/msg13886.html That's all... Hope this helps someone. -James -Original Message- From: Gary Struthers [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 7:02 PM To: Struts Users Mailing List Subject: Re: deploying in jboss 3 James Ward wrote: I am actually using 1.1B1, but It shouldn't make a difference. When you are running the example wars that come with struts make sure you do NOT have the struts.jar anywhere in JBoss's classloader (ie. deploy or any lib dirs). This will mess things up. -James Why will it mess things up? JBoss 3 has a unified class loader which is meant to solve problems caused by classes being differentiated by their class loader. Gary -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:struts-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
multiple .war error on FreeBSD (single .war was OK)
hi all, sorry about my english. I have a question, please tell me, if there a solution in message archive. my problem is, in my windows operating system, that's OK to copy struts-1.0.2/webapps/struts-*.war to tomcat-4.0.3/webapps/ and restart tomcat. in my FreeBSD, when i try to copy struts-example.war to tomcat-4.0.3/webapps/ it's ok. (cause it's single struts application). but, if i try to copy struts-example.war and struts-blank.war to tomcat-4.0.3/webapps/, then this errors is happen. please help my, why if I use multiple struts application, there's an errors. thanks for your help. ./oon this my environtment set (struts.jar not in my CLASSPATH) == ANT_HOME=/data1/apps/jakarta-ant-1.4.1 BASH=/usr/local/bin/bash BASH_ENV=/root/.bashrc BASH_VERSINFO=([0]=2 [1]=05 [2]=0 [3]=1 [4]=release [5]=i386--freebsd4.3) BASH_VERSION=$'2.05.0(1)-release' CATALINA_HOME=/data1/webapps/jakarta-tomcat-4.0.3 CLASSPATH=/data1/webapps/jakarta-tomcat-4.0.3/common/lib/servlet.jar:. HOME=/root JAVA_COMPILER=OpenJIT JAVA_HOME=/data1/apps/j2sdk1.3.1 OSTYPE=freebsd4.3 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/root/bin:/root/program/bin/:/sbin:/usr/sbin:/data1/apps/j2sdk1.3.1/bin:/data1/webapps/jakarta-tomcat-4.0.3/bin:/data1/apps/jakarta-ant-1.4.1/bin:/root PWD=/root SHELL=/usr/local/bin/bash SHELLOPTS=braceexpand:hashall:histexpand:monitor:history:interactive-comments:emacs TERM=xterm UID=0 USER=root == this my error's log. == 2002-06-13 01:11:29 jsp: init 2002-06-13 01:16:05 StandardHost[localhost]: Removing web application at context path /tomcat-docs 2002-06-13 01:16:05 StandardHost[localhost]: Removing web application at context path /struts-blank 2002-06-13 01:16:05 StandardHost[localhost]: Removing web application at context path /struts-documentation 2002-06-13 01:16:05 StandardHost[localhost]: Removing web application at context path /webdav 2002-06-13 01:16:05 StandardHost[localhost]: Removing web application at context path /examples 2002-06-13 01:16:05 StandardHost[localhost]: Removing web application at context path /struts-upload 2002-06-13 01:16:05 action: Finalizing this controller servlet 2002-06-13 01:16:05 StandardHost[localhost]: Removing web application at context path /struts-example 2002-06-13 01:16:06 StandardHost[localhost]: Removing web application at context path /manager 2002-06-13 01:16:06 StandardHost[localhost]: Removing web application at context path 2002-06-13 01:16:11 WebappLoader[/manager]: Deploying class repositories to work directory /data1/webapps/jakarta-tomcat-4.0.3/work/localhost/manager 2002-06-13 01:16:11 StandardManager[/manager]: Seeding random number generator class java.security.SecureRandom 2002-06-13 01:16:11 StandardManager[/manager]: Seeding of random number generator has been completed 2002-06-13 01:16:11 ContextConfig[/manager]: Configured an authenticator for method BASIC 2002-06-13 01:16:11 StandardWrapper[/manager:default]: Loading container servlet default 2002-06-13 01:16:11 default: init 2002-06-13 01:16:11 StandardWrapper[/manager:invoker]: Loading container servlet invoker 2002-06-13 01:16:11 invoker: init 2002-06-13 01:16:11 jsp: init 2002-06-13 01:16:11 StandardHost[localhost]: Installing web application at context path /tomcat-docs from URL file:/data1/webapps/jakarta-tomcat-4.0.3/webapps/tomcat-docs 2002-06-13 01:16:11 WebappLoader[/tomcat-docs]: Deploying class repositories to work directory /data1/webapps/jakarta-tomcat-4.0.3/work/localhost/tomcat-docs 2002-06-13 01:16:11 StandardManager[/tomcat-docs]: Seeding random number generator class java.security.SecureRandom 2002-06-13 01:16:11 StandardManager[/tomcat-docs]: Seeding of random number generator has been completed 2002-06-13 01:16:11 StandardWrapper[/tomcat-docs:default]: Loading container servlet default 2002-06-13 01:16:11 default: init 2002-06-13 01:16:11 StandardWrapper[/tomcat-docs:invoker]: Loading container servlet invoker 2002-06-13 01:16:11 invoker: init 2002-06-13 01:16:11 jsp: init 2002-06-13 01:16:11 StandardHost[localhost]: Installing web application at context path /webdav from URL file:/data1/webapps/jakarta-tomcat-4.0.3/webapps/webdav 2002-06-13 01:16:11 WebappLoader[/webdav]: Deploying class repositories to work directory /data1/webapps/jakarta-tomcat-4.0.3/work/localhost/webdav 2002-06-13 01:16:11 StandardManager[/webdav]: Seeding random number generator class java.security.SecureRandom 2002-06-13 01:16:11 StandardManager[/webdav]: Seeding of random number generator has been completed 2002-06-13 01:16:11 StandardWrapper[/webdav:default]: Loading container servlet default 2002-06-13 01:16:11 default: init 2002-06-13 01:16:11 StandardWrapper[/webdav:invoker]: Loading container servlet invoker 2002-06-13 01:16:11 invoker: init 2002-06-13 01:16:11 jsp: init 2002-06-13 01:16:11 StandardHost[localhost]: Installing web application at context path from URL file:/data1/webapps/jakarta-tomcat-4.0.3/webapps/ROOT
tomcat with security manager
I'm developing a webapp with tomcat and struts and must use a security manager in tomcat (the -security startup arg). I have the following problem: Tomcat has and uses commons-logging.jar Struts has and uses commons-logging.jar The two jar files are identical. Normally, one is supposed to include strust jar files and a bunch of other stuff with the webapp (basically static linking, which seems tragic with a platform like java :-( so all the jars in $STRUTS_HOME/lib are copied to WEB_INF/lib. If I run with -security, TOMCAT finds the commons-logging.jar in WEB_INF/lib first, gets the webapp permissions (ie. NOT java.security.AllPermission :-) and fails. It looks like a java.lang.ExceptionInInitializerError: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: java.lang.NullPointerException but if I turn on java.security.debug I see it is really that it is a security access problem - which is expected: code in the webapp should not be able to open and write files in $CATALINA_HOME/logs. If I remove the commons-logging.jar from the webapp, then tomcat is happy (it uses $CATALINA_HOME/server/lib/commons-logging.jar, which has the right permissions) BUT then struts can't find the logging classes, which looks like: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.apache.struts.util.MessageResourcesFactory.(MessageResourcesFactory.java:135) ... Granting java.security.AllPermission to webapps makes them work but is not an acceptable alternative because the webapp loads dynamic code that can't be trusted (either 'cause I wrote it and it's buggy or because someone else wrote it and it is buggy and/or malicious :-). Any ideas for a solution would be appreciated? Personally, it seems like tomcat is doing it wrong, but I thought I'd start here rather than cross-post right away. cheers, -- Patrick Dowler Canadian Astronomy Data Centre National Research Council Victoria, BC -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Session Management Methodology
I extended the Action class to do that. I have one Action class that does that and so on, and all my other Action classes extend it. Adam Dennis Muhlestein wrote: Using Struts 1.0.2 Some of my pages have ActionForms. Some only have Action Classes that do something. Some have nothing but an action mapping in the config xml file. Most of my pages however require a user to be logged in. Before I used Struts, I put session management in a common servlet. That can still work with struts, but the problem is, ActionForms get called and instantiated before the request gets to the Servlet. Is there a uniform place I could put session management that would apply to the Action before the ActionForm was called. I would like to have the user redireced to the login page first instead of after the ActionForm. Thanks Dennis -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
If several JSs share the same action mapping...?
How to do you deal with the input=? parameter when setting up an action mapping that different JSPs will share? I thought this input declaration was so if you are using validation it knows which page to return to with the validation errors. How is this accomplished when you have different JSPs that could share this action mapping but also need to be validated and thus I think also require the input field to be supplied? TIA -- Rick mailto:[EMAIL PROTECTED] Maybe in order to understand mankind, we have to look at the word itself: 'Mankind'. Basically, it's made up of two separate words - 'mank' and 'ind'. What do these words mean ? It's a mystery, and that's why so is mankind. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Session Management Methodology
Using Struts 1.0.2 Some of my pages have ActionForms. Some only have Action Classes that do something. Some have nothing but an action mapping in the config xml file. Most of my pages however require a user to be logged in. Before I used Struts, I put session management in a common servlet. That can still work with struts, but the problem is, ActionForms get called and instantiated before the request gets to the Servlet. Is there a uniform place I could put session management that would apply to the Action before the ActionForm was called. I would like to have the user redireced to the login page first instead of after the ActionForm. Thanks Dennis -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: deploying in jboss 3
This *definitely* matters ... Tomcat 4 has the same multi-class-loader architecture, and you'll experience the same sorts of issues. If you're using Struts 1.0.x, you can pretty much guarantee that you will have class not found issues if struts.jar is in a shared class loader. Struts 1.1b1 has changes that should address this, so it should work. The basic problem is that classes loaded from a parent (shared) class loader cannot directly see any classes loaded from your webapp class loader (i.e. /WEB-INF/classes and /WEB-INF/lib). So, for example, if the Struts ActionServlet was loaded from the parent, and your form bean class is defined in /WEB-INF/classes, Struts will have problems when it tries to execute: Class formBeanClass = this.getClass().getClassLoader().loadClass(formBeanClassName); In Struts 1.1, the workaround is based upon a promise by the container to supply a reference to the webapp class loader that can be accessed by shared classes. This promise is a requirement in Servlet 2.3, but is widely implemented on Servlet 2.2 containers -- and makes the following code work, even in the scenario we are talking about here: WebappClassLoader cl = Thread.currentThread().getContextClassLoader(); Class formBeanClass = cl.loadClass(formBeanClassName); Thanks for the insight Craig, makes sense, however: Why not just put the struts.jar into /WEB-INF/lib to avoid this issue? That way, the ActionServlet will be loaded by the webapp class loader and not by the parent(shared) class loader, so no problems, correct? Done this way, I suppose you could even use two different versions of Struts in 2 different web apps. I can also see why you might want struts.jar shared though -- if you have two web apps. both using the same version of Struts, you don't want to load all the classes twice. This seems to be the only scenario where putting struts.jar into a shared class loader makes sense. Am I missing something here? Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Ultradev / Struts Integration Question
Tom McAfee wrote: We tried to get this to work, also, and eventually gave up the attempt. All the CTLX extension seems to do is give you nice interfaces to the tag libraries -- the live data mode is a function of Ultradev proper, I believe. I'm talking through my hat a bit here, as I'm not an Ultradev expert, and I was just trying to get it to work for one of our view designers -- but it seemed like what you need to do is call each .do directly, and provide (within Ultradev) the necessary session variables to form context. Well, you mean call each JSP directly, and provide within Ultradev the request variables, etc. that the page uses. Yes, that's what I was alluding to in my original post about scriptlets... It just seems so WRONG... A sterner critic than I might chalk it up to the proclivity of the open-source community for making each other happy, but often falling short of providing something usable by the outside world. (OK, I admit, I'm trolling for some responses here . . .) Well, I think DWUD would be the missing link, so to speak, if not for this one glaring flaw. All we need is for live data mode to be able to request a different address than the JSP directly. I too thought the CTLX extension would solve this problem, but apparently I'm wrong or I'm just missing something. I have searched through every message that alludes to DWUD and everybody says how great it is, and nobody talks about the live data mode. That is the biggest advantage of using Ultradev, yet I can't make it work. In fact, after my post I realized it probably CAN'T work, since my actions will forward to a JSP of say name X.jsp, but DWUD will be creating temp files of X1091825091825125098.jsp or whatever. So my actions won't forward to that new view anyway. Being a server-side developer, the front-end development is my weakest skill. DWUD seemed like the perfect fit for me since I could see in realtime my changes to the page, but it's just going to cause me more tedious work to mock up test session/request variables for every page that can be included in the file during development. Is this really what all the developers are doing so they can hand off the page to a designer? Isn't anybody using live data mode with Struts? How are you doing it? Joe -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Session Management Methodology
I think filters are the best way to handle redirection to a logon screen, but that requires Servlet 2.3. Otherwise you have to either modify the ActionServlet to redirect before calling the Action or ActionForm, or put code in the Action that checks for a valid login before continuing. I would much prefer to use filters over either of these methods. Greg -Original Message- From: Dennis Muhlestein [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 2:20 PM To: [EMAIL PROTECTED] Subject: Session Management Methodology Using Struts 1.0.2 Some of my pages have ActionForms. Some only have Action Classes that do something. Some have nothing but an action mapping in the config xml file. Most of my pages however require a user to be logged in. Before I used Struts, I put session management in a common servlet. That can still work with struts, but the problem is, ActionForms get called and instantiated before the request gets to the Servlet. Is there a uniform place I could put session management that would apply to the Action before the ActionForm was called. I would like to have the user redireced to the login page first instead of after the ActionForm. Thanks Dennis -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: If several JSs share the same action mapping...?
Not sure why you are submitting a form from diff jsp, but one work around might be to forward to a known jsp I'm guessing that you are passing something to the action to tell it where you came from.. !-- Save mail subscription -- action path=/saveSubscription type=org.apache.struts.webapp.example.SaveSubscriptionAction name=subscriptionForm scope=request input=/WEB-INF/jsp/subscription.jsp forward name=success path=/editRegistration.do?action=Edit/ forward name=fail-jsp1 path=/jsp1.jsp/ forward name=fail-jsp2 path=/jsp2.jsp/ forward name=fail-jsp3 path=/jsp3.jsp/ !-- or you might use a different exception -- exception key=failure.reason1 type=org.apache.struts.webapp.exception.Reason1 path=/jsp1.jsp/ /action I didn't actually run this.so.hope it gives you some ideas. James Mitchell Software Engineer\Struts Evangelist Struts-Atlanta, the Open Minded Developer Network http://struts-atlanta.open-tools.org -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 3:31 PM To: Struts List Subject: If several JSs share the same action mapping...? How to do you deal with the input=? parameter when setting up an action mapping that different JSPs will share? I thought this input declaration was so if you are using validation it knows which page to return to with the validation errors. How is this accomplished when you have different JSPs that could share this action mapping but also need to be validated and thus I think also require the input field to be supplied? TIA -- Rick mailto:[EMAIL PROTECTED] Maybe in order to understand mankind, we have to look at the word itself: 'Mankind'. Basically, it's made up of two separate words - 'mank' and 'ind'. What do these words mean ? It's a mystery, and that's why so is mankind. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Issue with struts when generate reports from action class
Could you please explain this. I need to return a NULL ActionForward from my generate report action, because the response is already committed to the output stream. The PDF file is opened in a new window and not in the input JSP page. I want to clear the error messages from the input page. -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 1:13 PM To: Struts Users Mailing List Subject: RE: Issue with struts when generate reports from action class return the successful page with a meta-refresh to the pdf or use javascript HTH James Mitchell Software Engineer\Struts Evangelist Struts-Atlanta, the Open Minded Developer Network http://struts-atlanta.open-tools.org -Original Message- From: Nekkalapudi, Viplava [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 1:55 PM To: 'Struts Users Mailing List' Subject: Issue with struts when generate reports from action class Generating a PDF report from struts action class using 'iText' works fine. But We have a small issue related with Struts. When there is a validation error, The errors display on the input page. So we enter required data, and click 'Generate PDF report', Opens up Acrobat reader with the report. In this case how can we clear the errors on the input page? Right now, the error message still displays even after I open report. (We don't want to open PDF in the same browser window, So we used content-disposition as 'attachment'). Is there any way to refresh the input page, once the response is submitted. Thanks, Vip. -Original Message- From: Vincent Aumont [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 7:45 PM To: Struts Users Mailing List Subject: Re: some PDF stuff response.setHeader(Content-disposition,attachment; filename= + filename); I don't have a file name for the pdf I generate (may be I can have one). Any name will do. It's the name the browser uses should your user decide to save the document to disk. The Action class returns a NULL Action Forward. Same here. -Vincent. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Session Management Methodology
The standard wisdom is that you only do type-validation in the form and you do business validation later, i.e. make sure a date's a date and a number's a number. There's not exactly much overhead or drawback to doing that for everybody, whether they're logged in or not. If you're worried about wasting user's time if you're just going to reject them anyway, make sure you save their request info when you forward them to the login page. If you're really set on validating the user before validating the form content, you can access the request object in the validation method, so you can get the session and any stored login info to verify the user there. In that case you would probably want to subclass the ActionForm. Adam Dennis Muhlestein wrote: Thanks for the input. I thought of that. But what if My ActionForm needs to know who is logged in before it can validate the data. That's pushing it I know, I probably shouldn't validate that much data in a form. I don't think I am... but what if? Is there a standard way to intercept that or would I have to modify struts? Thanks Dennis On Wed, 2002-06-12 at 13:32, Adam Hardy wrote: I extended the Action class to do that. I have one Action class that does that and so on, and all my other Action classes extend it. Adam Dennis Muhlestein wrote: Using Struts 1.0.2 Some of my pages have ActionForms. Some only have Action Classes that do something. Some have nothing but an action mapping in the config xml file. Most of my pages however require a user to be logged in. Before I used Struts, I put session management in a common servlet. That can still work with struts, but the problem is, ActionForms get called and instantiated before the request gets to the Servlet. Is there a uniform place I could put session management that would apply to the Action before the ActionForm was called. I would like to have the user redireced to the login page first instead of after the ActionForm. Thanks Dennis -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Generating PDF question.
Question: What is the preferred way to generate PDF in struts? I'm currently looking at using STXX to transform XML to a PDF output and I've also briefly looked at Jasper Reports. STXX looks like it has the best fit, but it does have the b (Beta) word attached to it. What is the best solution which doesn't require too much learning curve. Thanks, Mike -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Session Management Methodology
I think a save way to achive this is to not Modify the ActionServlet, instead introduce another front Severvlet that will do your session management and have this servlet forward the request to the Struts' ActionServlet to continue the work. In another word this is like having a filter, but since silter is not support in any other servlet api that come before Servlet2.3. -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 12:38 PM To: [EMAIL PROTECTED] Subject: RE: Session Management Methodology I think filters are the best way to handle redirection to a logon screen, but that requires Servlet 2.3. Otherwise you have to either modify the ActionServlet to redirect before calling the Action or ActionForm, or put code in the Action that checks for a valid login before continuing. I would much prefer to use filters over either of these methods. Greg -Original Message- From: Dennis Muhlestein [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 2:20 PM To: [EMAIL PROTECTED] Subject: Session Management Methodology Using Struts 1.0.2 Some of my pages have ActionForms. Some only have Action Classes that do something. Some have nothing but an action mapping in the config xml file. Most of my pages however require a user to be logged in. Before I used Struts, I put session management in a common servlet. That can still work with struts, but the problem is, ActionForms get called and instantiated before the request gets to the Servlet. Is there a uniform place I could put session management that would apply to the Action before the ActionForm was called. I would like to have the user redireced to the login page first instead of after the ActionForm. Thanks Dennis -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Issue with struts when generate reports from action class
At 2:33 PM -0500 2002/06/12, Nekkalapudi, Viplava wrote: Could you please explain this. I need to return a NULL ActionForward from my generate report action, because the response is already committed to the output stream. The PDF file is opened in a new window and not in the input JSP page. I want to clear the error messages from the input page. Don't write the PDF to the output stream when you do now. Instead, return an ActionMapping which causes the input page to be refreshed. In that input page, have a conditional block which recognizes that things are good to make the PDF, and inside that block, cause the browser to load the PDF. You could do that with meta http-equiv=refresh... (but then i don't think you can make it happen in a new window) or you could do it with javascript. If you insist on generating the PDF when you do now, write it to the filesystem instead, and have the automated bit load the PDF directly; alternatively, defer generating the PDF to a separate action (which is probably a cleaner separation of concerns anyway) and have the automated bit call that action, causing the PDF to be generated. Does that make sense? Joe -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 1:13 PM To: Struts Users Mailing List Subject: RE: Issue with struts when generate reports from action class return the successful page with a meta-refresh to the pdf or use javascript HTH James Mitchell Software Engineer\Struts Evangelist Struts-Atlanta, the Open Minded Developer Network http://struts-atlanta.open-tools.org -Original Message- From: Nekkalapudi, Viplava [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 1:55 PM To: 'Struts Users Mailing List' Subject: Issue with struts when generate reports from action class Generating a PDF report from struts action class using 'iText' works fine. But We have a small issue related with Struts. When there is a validation error, The errors display on the input page. So we enter required data, and click 'Generate PDF report', Opens up Acrobat reader with the report. In this case how can we clear the errors on the input page? Right now, the error message still displays even after I open report. (We don't want to open PDF in the same browser window, So we used content-disposition as 'attachment'). Is there any way to refresh the input page, once the response is submitted. Thanks, Vip. -Original Message- From: Vincent Aumont [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 7:45 PM To: Struts Users Mailing List Subject: Re: some PDF stuff response.setHeader(Content-disposition,attachment; filename= + filename); I don't have a file name for the pdf I generate (may be I can have one). Any name will do. It's the name the browser uses should your user decide to save the document to disk. The Action class returns a NULL Action Forward. Same here. -Vincent. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- -- * Joe Germuska{ [EMAIL PROTECTED] } It's pitiful, sometimes, if they've got it bad. Their eyes get glazed, they go white, their hands tremble As I watch them I often feel that a dope peddler is a gentleman compared with the man who sells records. --Sam Goody, 1956 tune in posse radio: http://www.live365.com/stations/289268 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re[2]: If several JSPs share the same action mapping...?
Sorry James, I don't think I described the situation to well and I'm sure there probably is a better way to handle this... Easiest way is an extreme example.. What if you had 4 different JSPs that captured the same information in a form YET everything else on the page was radically different. Upon submission, though, you want to forward all the pages to the same Action and even possibly forward all of them to the same results page. The problem(I think) is you also want to validate the form information. I'm wondering how you would get the validation to know to return back to the correct JSP page if there were validation errors? I thought you needed to provide the input=yourJsp.jsp so that it knew were to go back to, but if all 4 jsps shared this action mapping what would you put in the input=? section? (maybe I'm totally wrong and the validation doesn't need that but I thought it did). Thanks for the help, Rick On Wednesday, June 12, 2002, 3:43:18 PM, James wrote: JM Not sure why you are submitting a form from diff jsp, but one work JM around might be to forward to a known jsp JM I'm guessing that you are passing something to the action to tell it where JM you came from.. JM !-- Save mail subscription -- JM action path=/saveSubscription JMtype=org.apache.struts.webapp.example.SaveSubscriptionAction JMname=subscriptionForm JM scope=request JM input=/WEB-INF/jsp/subscription.jsp JM forward name=success path=/editRegistration.do?action=Edit/ JM forward name=fail-jsp1 path=/jsp1.jsp/ JM forward name=fail-jsp2 path=/jsp2.jsp/ JM forward name=fail-jsp3 path=/jsp3.jsp/ JM !-- or you might use a different exception -- JM exception JM key=failure.reason1 JMtype=org.apache.struts.webapp.exception.Reason1 JMpath=/jsp1.jsp/ JM /action JM I didn't actually run this.so.hope it gives you some ideas. JM James Mitchell JM Software Engineer\Struts Evangelist JM Struts-Atlanta, the Open Minded Developer Network JM http://struts-atlanta.open-tools.org -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 3:31 PM To: Struts List Subject: If several JSs share the same action mapping...? How to do you deal with the input=? parameter when setting up an action mapping that different JSPs will share? I thought this input declaration was so if you are using validation it knows which page to return to with the validation errors. How is this accomplished when you have different JSPs that could share this action mapping but also need to be validated and thus I think also require the input field to be supplied? TIA -- Rick mailto:[EMAIL PROTECTED] Maybe in order to understand mankind, we have to look at the word itself: 'Mankind'. Basically, it's made up of two separate words - 'mank' and 'ind'. What do these words mean ? It's a mystery, and that's why so is mankind. -Jack Handey -- To unsubscribe, e-mail: JM mailto:[EMAIL PROTECTED] JM For additional commands, e-mail: JM mailto:[EMAIL PROTECTED] -- Rick mailto:[EMAIL PROTECTED] It's amazing to me that one of the world's most feared diseases would be carried by one of the world's smallest animals: the real tiny dog. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How get a translated message into a custom tag attribute
Platform: Intel PIII, RedHat 7.2, BlackDown JDK 1.3.1, Tomcat 3.2, Struts 1.0 If you have a custom tag mypage:head that has an argument title (which, not surprisingly, results in an HTML title tag), is it possible to insert a struts translation for the attribute value? Eg. if the tag is mypage:head title=Some Wonderful Page / I would instead like to have the property wonderful.title=Some Wonderful Page and give the title attribute the string that would have the result of bean:message key=wonderful.title/ Thanx! - Steinar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How get a translated message into a custom tag attribute
I think you are not using the best design here. But then, I could be wrong. Can you provide a use case for this scenario??? James Mitchell Software Engineer\Struts Evangelist Struts-Atlanta, the Open Minded Developer Network http://struts-atlanta.open-tools.org -Original Message- From: news [mailto:[EMAIL PROTECTED]]On Behalf Of Steinar Bang Sent: Wednesday, June 12, 2002 10:36 AM To: [EMAIL PROTECTED] Subject: How get a translated message into a custom tag attribute Platform: Intel PIII, RedHat 7.2, BlackDown JDK 1.3.1, Tomcat 3.2, Struts 1.0 If you have a custom tag mypage:head that has an argument title (which, not surprisingly, results in an HTML title tag), is it possible to insert a struts translation for the attribute value? Eg. if the tag is mypage:head title=Some Wonderful Page / I would instead like to have the property wonderful.title=Some Wonderful Page and give the title attribute the string that would have the result of bean:message key=wonderful.title/ Thanx! - Steinar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: forward to a tile definition.........
Raffy already point it out, but thanks anyway for updating the docs. -Original Message- From: Cedric Dumoulin [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 9:17 AM To: Struts Users Mailing List Subject: Re: forward to a tile definition. In http://www.lifl.fr/~dumoulin/tiles/doc/installation.html. I have to admit that is not so well explained. A simple installation guide with Struts1.1 is missing. Cedric Trieu, Danny wrote: do you know where in the tiles distribution that Cedric talk about this? -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 10:54 AM To: Struts Users Mailing List Subject: Re: forward to a tile definition. Do you have the following entry in your struts-config.xml? !-- Tiles -- controller processorClass=org.apache.struts.tiles.TilesRequestProcessor / Trieu, Danny [EMAIL PROTECTED] on 06/03/2002 10:45:10 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] cc: Subject: forward to a tile definition. Hi all, Does anyone know why ActionForward can't find my Tiles' definition? When I used:forward name=success path=my.tile.definition.page / it is giving me the HTTP 500 Internal server error. I guess it couldn't find my definition or doesn't have a clue what path is. But if I create a test.jsp, and have the definition inserted, the it works.. I have my action servlet set to use servlet-nameaction/servlet-name servlet-classorg.apache.struts.tiles.ActionComponentServlet/servlet-cla ss I am using Struts1.1 with Weblogic 6.1sp2 Thanks, Danny -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ** Please Note: The information in this E-mail message, and any files transmitted with it, is confidential and may be legally privileged. It is intended only for the use of the individual(s) named above. If you are the intended recipient, be aware that your use of any confidential or personal information may be restricted by state and federal privacy laws. If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this E-mail message. If you have received this E-mail in error, please notify the sender and delete the material from any computer. Thank you. ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Generating PDF question.
You can try iText also, http://www.lowagie.com/iText -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 2:54 PM To: [EMAIL PROTECTED] Subject: Generating PDF question. Question: What is the preferred way to generate PDF in struts? I'm currently looking at using STXX to transform XML to a PDF output and I've also briefly looked at Jasper Reports. STXX looks like it has the best fit, but it does have the b (Beta) word attached to it. What is the best solution which doesn't require too much learning curve. Thanks, Mike -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Protecting PDF and other non-jsp files
In my .jsp pages I can check if a session var has been set to determin if a page can viewed or not. How can I protect .pdf and other types of files (in an OS-independent way)? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Session Management Methodology
Thanks for the input. I thought of that. But what if My ActionForm needs to know who is logged in before it can validate the data. That's pushing it I know, I probably shouldn't validate that much data in a form. I don't think I am... but what if? Is there a standard way to intercept that or would I have to modify struts? Thanks Dennis On Wed, 2002-06-12 at 13:32, Adam Hardy wrote: I extended the Action class to do that. I have one Action class that does that and so on, and all my other Action classes extend it. Adam Dennis Muhlestein wrote: Using Struts 1.0.2 Some of my pages have ActionForms. Some only have Action Classes that do something. Some have nothing but an action mapping in the config xml file. Most of my pages however require a user to be logged in. Before I used Struts, I put session management in a common servlet. That can still work with struts, but the problem is, ActionForms get called and instantiated before the request gets to the Servlet. Is there a uniform place I could put session management that would apply to the Action before the ActionForm was called. I would like to have the user redireced to the login page first instead of after the ActionForm. Thanks Dennis -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: If several JSPs share the same action mapping...?
Right, you will not know which jsp submitted the form unless you: 1. find out from the request (request uri) 2. tell the action by some hidden form var or on the url action (html) either way you've got to create a hack to pass the correct ActionForward. sorry for my quick (not-so-pretty) replies, I'm working on a hot project and coding on one machine and monitoring the list on the laptop. I'm multi-tasking both mentally, and physically ;) (My alt-tab is a quarter turn to the left) James Mitchell Software Engineer\Struts Evangelist Struts-Atlanta, the Open Minded Developer Network http://struts-atlanta.open-tools.org -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 3:59 PM To: James Mitchell Cc: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re[2]: If several JSPs share the same action mapping...? Sorry James, I don't think I described the situation to well and I'm sure there probably is a better way to handle this... Easiest way is an extreme example.. What if you had 4 different JSPs that captured the same information in a form YET everything else on the page was radically different. Upon submission, though, you want to forward all the pages to the same Action and even possibly forward all of them to the same results page. The problem(I think) is you also want to validate the form information. I'm wondering how you would get the validation to know to return back to the correct JSP page if there were validation errors? I thought you needed to provide the input=yourJsp.jsp so that it knew were to go back to, but if all 4 jsps shared this action mapping what would you put in the input=? section? (maybe I'm totally wrong and the validation doesn't need that but I thought it did). Thanks for the help, Rick On Wednesday, June 12, 2002, 3:43:18 PM, James wrote: JM Not sure why you are submitting a form from diff jsp, but one work JM around might be to forward to a known jsp JM I'm guessing that you are passing something to the action to tell it where JM you came from.. JM !-- Save mail subscription -- JM action path=/saveSubscription JM type=org.apache.struts.webapp.example.SaveSubscriptionAction JMname=subscriptionForm JM scope=request JM input=/WEB-INF/jsp/subscription.jsp JM forward name=success path=/editRegistration.do?action=Edit/ JM forward name=fail-jsp1 path=/jsp1.jsp/ JM forward name=fail-jsp2 path=/jsp2.jsp/ JM forward name=fail-jsp3 path=/jsp3.jsp/ JM !-- or you might use a different exception -- JM exception JM key=failure.reason1 JMtype=org.apache.struts.webapp.exception.Reason1 JMpath=/jsp1.jsp/ JM /action JM I didn't actually run this.so.hope it gives you some ideas. JM James Mitchell JM Software Engineer\Struts Evangelist JM Struts-Atlanta, the Open Minded Developer Network JM http://struts-atlanta.open-tools.org -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 3:31 PM To: Struts List Subject: If several JSs share the same action mapping...? How to do you deal with the input=? parameter when setting up an action mapping that different JSPs will share? I thought this input declaration was so if you are using validation it knows which page to return to with the validation errors. How is this accomplished when you have different JSPs that could share this action mapping but also need to be validated and thus I think also require the input field to be supplied? TIA -- Rick mailto:[EMAIL PROTECTED] Maybe in order to understand mankind, we have to look at the word itself: 'Mankind'. Basically, it's made up of two separate words - 'mank' and 'ind'. What do these words mean ? It's a mystery, and that's why so is mankind. -Jack Handey -- To unsubscribe, e-mail: JM mailto:[EMAIL PROTECTED] JM For additional commands, e-mail: JM mailto:[EMAIL PROTECTED] -- Rick mailto:[EMAIL PROTECTED] It's amazing to me that one of the world's most feared diseases would be carried by one of the world's smallest animals: the real tiny dog. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Using redirect=true with tiles component
I guess what Cedric meant was, if a request is not is not going into the Controller there is noway Tile know what definition render the result for the response. What you can do is define a Struts Action or Forward that referenced your intent definition. -Original Message- From: Cedric Dumoulin [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 9:15 AM To: Struts Users Mailing List Subject: Re: Using redirect=true with tiles component Hello, You can't use redirect=true with a tiles definition's name. Tiles definition's names are logical names, not URL, so it is not possible to redirect to a definition name. In the same way, it is not possible to use directly a definition name in a link. Hope this help, Cedric [EMAIL PROTECTED] wrote: I have the following entry in my config action path=/login type=com.ffic.training.LoginAction name=logonForm scope=session input=/Login.jsp forward name=success path=welcome.page redirect=true/ /action My tiles definition xml is as follows definition name=welcome.page path=/TilesTemplate.jsp put name=menu content=/Menu.jsp/ put name=body content=/WelcomeContent.jsp/ /definition Without the redirect=true, everything works fine, but when I use it, I get the following error Error 404 An error has occured while processing request:http://localhost:8080/app/welcome.page Message: File not found: //welcome.page If I change the path to a regular jsp path (ie path=/Welcome.jsp) things work fine. Can anyone help me on this? Thanks in advance. ** Please Note: The information in this E-mail message, and any files transmitted with it, is confidential and may be legally privileged. It is intended only for the use of the individual(s) named above. If you are the intended recipient, be aware that your use of any confidential or personal information may be restricted by state and federal privacy laws. If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this E-mail message. If you have received this E-mail in error, please notify the sender and delete the material from any computer. Thank you. ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Protecting PDF and other non-jsp files
tomcat provides a nice way of doing this.@see the docs James Mitchell Software Engineer\Struts Evangelist Struts-Atlanta, the Open Minded Developer Network http://struts-atlanta.open-tools.org -Original Message- From: Brad Rhoads [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 4:10 PM To: 'Struts Users Mailing List' Subject: Protecting PDF and other non-jsp files In my .jsp pages I can check if a session var has been set to determin if a page can viewed or not. How can I protect .pdf and other types of files (in an OS-independent way)? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How get a translated message into a custom tag attribute
James Mitchell [EMAIL PROTECTED]: I think you are not using the best design here. You mean having something that needs translation in an attribute? I would tend to agree. :-) But then, I could be wrong. Can you provide a use case for this scenario??? I was looking for a way to avoid rewriting an existing tag library, when introducing i18n support in the JSP pages using it. Looks like there's no way around changing the semantics of the attribute. Ie. making it a key for a property, rather than the text to be presented. I'll look into changing the tag lib tomorrow. Thanx! - Steinar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Problem with classes not being updated....
This was already set to Developer mode. Anyone else have any ideas? (Note: I've uninstalled weblogic and reinstalled the SP2 version and the problem still exists.) Mike -Original Message- From: Chris Hardin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 1:50 PM To: [EMAIL PROTECTED] Subject: Re: Problem with classes not being updated Open your Weblogic start script and set set STARTMODE=false; From: Mike Poole [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Problem with classes not being updated Date: Tue, 11 Jun 2002 10:45:19 -0700 Hi. I'm having a strange problem using Struts in a Weblogic environment. The problem is that my classes are not being updated when I make changes to them. The classpath is correct, and there is only one copy of the each class on the machine, and there are no jars or wars that contain the class. But makeing changes to a class (even deleting it) does not change the behavior of the web application. This is true of both my action classes and my tags. JSPs get reloaded properly; and shutting down and restarting Weblogic will properly reload all the classes as well. Has anyone seen this? It seems to be Struts related because deploying a simple class and using it on a simple JSP works fine and auto reloads when I update the class. Thanks, Mike -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Chris L Hardin Java/J2EE Developer Enterprise Consulting _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Using redirect=true with tiles component
Credic, I just want to know what your though is on this issue. I want to provide some caching capability for Tiles. Let's say you will have an attribute in the tiles:insert cache=true cacheScope=session definition=someTile /, tile will look for content from cache and return quickly, if there isn't one, tiles will insert one into cache when it finished rendering its part. I want to know if you see any value of doing this, and if I am going to extend tiles to do this, what is your advice on where in the Tiles framework that this can be done. Or if you already have plan on doing this, please share your design with us. Thanks, danny ps. I am still learning the Tiles' source code. -Original Message- From: Trieu, Danny [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 1:16 PM To: 'Struts Users Mailing List' Subject: RE: Using redirect=true with tiles component I guess what Cedric meant was, if a request is not is not going into the Controller there is noway Tile know what definition render the result for the response. What you can do is define a Struts Action or Forward that referenced your intent definition. -Original Message- From: Cedric Dumoulin [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 9:15 AM To: Struts Users Mailing List Subject:Re: Using redirect=true with tiles component Hello, You can't use redirect=true with a tiles definition's name. Tiles definition's names are logical names, not URL, so it is not possible to redirect to a definition name. In the same way, it is not possible to use directly a definition name in a link. Hope this help, Cedric [EMAIL PROTECTED] wrote: I have the following entry in my config action path=/login type=com.ffic.training.LoginAction name=logonForm scope=session input=/Login.jsp forward name=success path=welcome.page redirect=true/ /action My tiles definition xml is as follows definition name=welcome.page path=/TilesTemplate.jsp put name=menu content=/Menu.jsp/ put name=body content=/WelcomeContent.jsp/ /definition Without the redirect=true, everything works fine, but when I use it, I get the following error Error 404 An error has occured while processing request:http://localhost:8080/app/welcome.page Message: File not found: //welcome.page If I change the path to a regular jsp path (ie path=/Welcome.jsp) things work fine. Can anyone help me on this? Thanks in advance. ** Please Note: The information in this E-mail message, and any files transmitted with it, is confidential and may be legally privileged. It is intended only for the use of the individual(s) named above. If you are the intended recipient, be aware that your use of any confidential or personal information may be restricted by state and federal privacy laws. If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this E-mail message. If you have received this E-mail in error, please notify the sender and delete the material from any computer. Thank you. ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DynaCache for Tiles
-Original Message- From: Trieu, Danny [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 1:26 PM To: 'Struts Users Mailing List' Subject: RE: Using redirect=true with tiles component Credic, I just want to know what your though is on this issue. I want to provide some caching capability for Tiles. Let's say you will have an attribute in the tiles:insert cache=true cacheScope=session definition=someTile /, tile will look for content from cache and return quickly, if there isn't one, tiles will insert one into cache when it finished rendering its part. I want to know if you see any value of doing this, and if I am going to extend tiles to do this, what is your advice on where in the Tiles framework that this can be done. Or if you already have plan on doing this, please share your design with us. Thanks, danny ps. I am still learning the Tiles' source code. -Original Message- From: Trieu, Danny [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 1:16 PM To: 'Struts Users Mailing List' Subject:RE: Using redirect=true with tiles component I guess what Cedric meant was, if a request is not is not going into the Controller there is noway Tile know what definition render the result for the response. What you can do is define a Struts Action or Forward that referenced your intent definition. -Original Message- From: Cedric Dumoulin [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 9:15 AM To: Struts Users Mailing List Subject: Re: Using redirect=true with tiles component Hello, You can't use redirect=true with a tiles definition's name. Tiles definition's names are logical names, not URL, so it is not possible to redirect to a definition name. In the same way, it is not possible to use directly a definition name in a link. Hope this help, Cedric [EMAIL PROTECTED] wrote: I have the following entry in my config action path=/login type=com.ffic.training.LoginAction name=logonForm scope=session input=/Login.jsp forward name=success path=welcome.page redirect=true/ /action My tiles definition xml is as follows definition name=welcome.page path=/TilesTemplate.jsp put name=menu content=/Menu.jsp/ put name=body content=/WelcomeContent.jsp/ /definition Without the redirect=true, everything works fine, but when I use it, I get the following error Error 404 An error has occured while processing request:http://localhost:8080/app/welcome.page Message: File not found: //welcome.page If I change the path to a regular jsp path (ie path=/Welcome.jsp) things work fine. Can anyone help me on this? Thanks in advance. ** Please Note: The information in this E-mail message, and any files transmitted with it, is confidential and may be legally privileged. It is intended only for the use of the individual(s) named above. If you are the intended recipient, be aware that your use of any confidential or personal information may be restricted by state and federal privacy laws. If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this E-mail message. If you have received this E-mail in error, please notify the sender and delete the material from any computer. Thank you. ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Setting a hidden form field.
I am trying to set a hidden field from one of the array elements in a bean like: I have a bean A with String[] B. I am trying to do html:hidden name=beanname property=B[0] What method do I need in this form class to have this value set. I have created bean methods get/setB().. but it is giving an error while trying to set this value to the form bean: java.lang.IllegalArgumentException: array element type mismatch at java.lang.reflect.Array.set(Native Method) at org.apache.struts.util.PropertyUtils.setIndexedProperty(PropertyUtils.java:851) at org.apache.struts.util.PropertyUtils.setIndexedProperty(PropertyUtils.java:785) at org.apache.struts.util.PropertyUtils.setNestedProperty(PropertyUtils.java:902) at org.apache.struts.util.PropertyUtils.setProperty(PropertyUtils.java:932) at org.apache.struts.util.BeanUtils.populate(BeanUtils.java:509) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:772) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:2061) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) Can someone please throw some light on this. thanks. george __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: User Authentication
That's the part I was talking about. Tomcat and Resin aren't too bad, but I never have found an example of container managed security with Websphere. WebSphere uses its CustomRegistry interface for the database access layer of container managed security. Please see http://www-3.ibm.com/software/webservers/appserv/doc/v40/ae/infocenter/w as/050201.html for the interface spec. Read the rest of the chapter 5 for information about other aspects of WebSphere security. -TPP -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Setting a hidden form field.
Hi Geoge I think you need to define the methods getB(index) and setB(index, value) to use Indexed Reference. regards Gopal -Original Message- From: geoge m [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 4:33 PM To: [EMAIL PROTECTED] Subject: Setting a hidden form field. I am trying to set a hidden field from one of the array elements in a bean like: I have a bean A with String[] B. I am trying to do html:hidden name=beanname property=B[0] What method do I need in this form class to have this value set. I have created bean methods get/setB().. but it is giving an error while trying to set this value to the form bean: java.lang.IllegalArgumentException: array element type mismatch at java.lang.reflect.Array.set(Native Method) at org.apache.struts.util.PropertyUtils.setIndexedProperty(PropertyUtils.java:8 51) at org.apache.struts.util.PropertyUtils.setIndexedProperty(PropertyUtils.java:7 85) at org.apache.struts.util.PropertyUtils.setNestedProperty(PropertyUtils.java:90 2) at org.apache.struts.util.PropertyUtils.setProperty(PropertyUtils.java:932) at org.apache.struts.util.BeanUtils.populate(BeanUtils.java:509) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:772) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:20 61) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) Can someone please throw some light on this. thanks. george __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Session Management Methodology
I created a filter as advised by Greg. It works wonderfully. You could protect requests for any resource with Filters. See suns j2ee web tutorial for a filter example. On Wed, 2002-06-12 at 13:19, Dennis Muhlestein wrote: Using Struts 1.0.2 Some of my pages have ActionForms. Some only have Action Classes that do something. Some have nothing but an action mapping in the config xml file. Most of my pages however require a user to be logged in. Before I used Struts, I put session management in a common servlet. That can still work with struts, but the problem is, ActionForms get called and instantiated before the request gets to the Servlet. Is there a uniform place I could put session management that would apply to the Action before the ActionForm was called. I would like to have the user redireced to the login page first instead of after the ActionForm. Thanks Dennis -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: If several JSPs share the same action mapping...?
You may be confusing Actions with action-mappings. Each JSP can have its own action-mapping, and own input settings, and the rest of it, and all the action-mappings can share the same Action. Of course, action-mappings can also share JSPs, and so forth. There are no 1:1's here. -T. Rick Reumann wrote: Sorry James, I don't think I described the situation to well and I'm sure there probably is a better way to handle this... Easiest way is an extreme example.. What if you had 4 different JSPs that captured the same information in a form YET everything else on the page was radically different. Upon submission, though, you want to forward all the pages to the same Action and even possibly forward all of them to the same results page. The problem(I think) is you also want to validate the form information. I'm wondering how you would get the validation to know to return back to the correct JSP page if there were validation errors? I thought you needed to provide the input=yourJsp.jsp so that it knew were to go back to, but if all 4 jsps shared this action mapping what would you put in the input=? section? (maybe I'm totally wrong and the validation doesn't need that but I thought it did). Thanks for the help, Rick On Wednesday, June 12, 2002, 3:43:18 PM, James wrote: JM Not sure why you are submitting a form from diff jsp, but one work JM around might be to forward to a known jsp JM I'm guessing that you are passing something to the action to tell it where JM you came from.. JM !-- Save mail subscription -- JM action path=/saveSubscription JMtype=org.apache.struts.webapp.example.SaveSubscriptionAction JMname=subscriptionForm JM scope=request JM input=/WEB-INF/jsp/subscription.jsp JM forward name=success path=/editRegistration.do?action=Edit/ JM forward name=fail-jsp1 path=/jsp1.jsp/ JM forward name=fail-jsp2 path=/jsp2.jsp/ JM forward name=fail-jsp3 path=/jsp3.jsp/ JM !-- or you might use a different exception -- JM exception JM key=failure.reason1 JMtype=org.apache.struts.webapp.exception.Reason1 JMpath=/jsp1.jsp/ JM /action JM I didn't actually run this.so.hope it gives you some ideas. JM James Mitchell JM Software Engineer\Struts Evangelist JM Struts-Atlanta, the Open Minded Developer Network JM http://struts-atlanta.open-tools.org -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 3:31 PM To: Struts List Subject: If several JSs share the same action mapping...? How to do you deal with the input=? parameter when setting up an action mapping that different JSPs will share? I thought this input declaration was so if you are using validation it knows which page to return to with the validation errors. How is this accomplished when you have different JSPs that could share this action mapping but also need to be validated and thus I think also require the input field to be supplied? TIA -- Rick mailto:[EMAIL PROTECTED] Maybe in order to understand mankind, we have to look at the word itself: 'Mankind'. Basically, it's made up of two separate words - 'mank' and 'ind'. What do these words mean ? It's a mystery, and that's why so is mankind. -Jack Handey -- To unsubscribe, e-mail: JM mailto:[EMAIL PROTECTED] JM For additional commands, e-mail: JM mailto:[EMAIL PROTECTED] -- Rick mailto:[EMAIL PROTECTED] It's amazing to me that one of the world's most feared diseases would be carried by one of the world's smallest animals: the real tiny dog. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Setting a hidden form field.
Thanks a bunch Gopal. --- [EMAIL PROTECTED] wrote: Hi Geoge I think you need to define the methods getB(index) and setB(index, value) to use Indexed Reference. regards Gopal -Original Message- From: geoge m [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 4:33 PM To: [EMAIL PROTECTED] Subject: Setting a hidden form field. I am trying to set a hidden field from one of the array elements in a bean like: I have a bean A with String[] B. I am trying to do html:hidden name=beanname property=B[0] What method do I need in this form class to have this value set. I have created bean methods get/setB().. but it is giving an error while trying to set this value to the form bean: java.lang.IllegalArgumentException: array element type mismatch at java.lang.reflect.Array.set(Native Method) at org.apache.struts.util.PropertyUtils.setIndexedProperty(PropertyUtils.java:8 51) at org.apache.struts.util.PropertyUtils.setIndexedProperty(PropertyUtils.java:7 85) at org.apache.struts.util.PropertyUtils.setNestedProperty(PropertyUtils.java:90 2) at org.apache.struts.util.PropertyUtils.setProperty(PropertyUtils.java:932) at org.apache.struts.util.BeanUtils.populate(BeanUtils.java:509) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:772) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:20 61) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) Can someone please throw some light on this. thanks. george __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Setting a hidden form field.
You might want to try something like input type='hidden' name='whatever' value='bean:write name=beanname property=foo[2]/' which would call the equivalent of beanname.getFoo(2); geoge m wrote: I am trying to set a hidden field from one of the array elements in a bean like: I have a bean A with String[] B. I am trying to do html:hidden name=beanname property=B[0] What method do I need in this form class to have this value set. I have created bean methods get/setB().. but it is giving an error while trying to set this value to the form bean: java.lang.IllegalArgumentException: array element type mismatch at java.lang.reflect.Array.set(Native Method) at org.apache.struts.util.PropertyUtils.setIndexedProperty(PropertyUtils.java:851) at org.apache.struts.util.PropertyUtils.setIndexedProperty(PropertyUtils.java:785) at org.apache.struts.util.PropertyUtils.setNestedProperty(PropertyUtils.java:902) at org.apache.struts.util.PropertyUtils.setProperty(PropertyUtils.java:932) at org.apache.struts.util.BeanUtils.populate(BeanUtils.java:509) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:772) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:2061) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) Can someone please throw some light on this. thanks. george __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Need help for debugging ActionServlet configuration
Hello, I have spent considerable amount of time in trying to debug this and still havent been successful. For some reason, my ActionServlet is not getting loaded and I was logging the following error messages in the Tomcat logs: -- --- --- 2002-06-12 16:44:41 StandardWrapper[/SupplierModule:default]: Loading container servlet default 2002-06-12 16:44:41 default: init 2002-06-12 16:44:42 supplier: init 2002-06-12 16:44:42 StandardWrapper[/SupplierModule:supplier]: Marking servlet supplier as unavailable 2002-06-12 16:44:42 StandardContext[/SupplierModule]: Servlet /SupplierModule threw load() exception javax.servlet.UnavailableException at org.apache.struts.action.ActionServlet.initApplicationPlugIns(ActionServlet.java:931) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:421) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at org.apache.catalina.core.StandardWrapper.loadServlet(Unknown Source) at org.apache.catalina.core.StandardWrapper.load(Unknown Source) at org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source) at org.apache.catalina.core.StandardContext.start(Unknown Source) at org.apache.catalina.core.ContainerBase.addChildInternal(Unknown Source) at org.apache.catalina.core.ContainerBase.addChild(Unknown Source) at org.apache.catalina.core.StandardHost.addChild(Unknown Source) at org.apache.catalina.core.StandardHostDeployer.install(Unknown Source) at org.apache.catalina.core.StandardHost.install(Unknown Source) at org.apache.catalina.startup.HostConfig.deployDirectories(Unknown Source) at org.apache.catalina.startup.HostConfig.deployApps(Unknown Source) at org.apache.catalina.startup.HostConfig.start(Unknown Source) at org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown Source) at org.apache.catalina.core.ContainerBase.start(Unknown Source) at org.apache.catalina.core.StandardHost.start(Unknown Source) at org.apache.catalina.core.ContainerBase.start(Unknown Source) at org.apache.catalina.core.StandardEngine.start(Unknown Source) at org.apache.catalina.core.StandardService.start(Unknown Source) at org.apache.catalina.core.StandardServer.start(Unknown Source) at org.apache.catalina.startup.Catalina.start(Unknown Source) at org.apache.catalina.startup.Catalina.execute(Unknown Source) at org.apache.catalina.startup.Catalina.process(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Unknown Source) 2002-06-12 16:44:42 StandardWrapper[/SupplierModule:invoker]: Loading container servlet invoker 2002-06-12 16:44:42 invoker: init 2002-06-12 16:44:42 jsp: init --- --- -- My web.xml file looks like follows (nothing majorly different ..) !-- Action Servlet Configuration -- servlet servlet-namesupplier/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namedebug/param-name param-value3/param-value /init-param init-param param-namedetail/param-name param-value3/param-value /init-param load-on-startup2/load-on-startup /servlet !-- Action Servlet Mapping -- servlet-mapping servlet-namesupplier/servlet-name url-pattern*.do/url-pattern /servlet-mapping --- Any idea if this is due to Tomcat or something that I setup in my web.xml file and cant see it Thanks much... Muki Soomar Solutions Architect Consumer Facing Practice Global Consumer Systems 4S-110, Regent Court Phone: (313) 20-64687 Ford Motor Co. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Performance and Scalability Information?
Hello- Currently my company is using lots of different servlets written by lots of different people in lots of different styles. We want to adopt a framework and start coding within that framework. Struts is at the top of our list of frameworks however we do have some questions about performance and scalability. I dug through the mail archive for 'performance' and only found comments related to JSP's and taglibs. How do other parts of Struts fair under heavy usage? Are there any known bottle necks or performance issues? Does anyone have any statics or benchmarks on Struts performance? Thanks- Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
iPlanet + Struts Problem
I'm having a problem getting a very simple Struts application to work on iPlanet Web Server 6.0 SP1 + iPlanet Application Server 6.0 SP4. JSPs using the struts taglibs seem to work properly, but whenever I try to request a page that matches the *.do url pattern, I get the following in my browser: GX Error (GX2GX) socket result code missing!!! As far as I know, I have deployed the application properly; the iAS Deployment Tool shows that the action servlet is mapped to the *.do URL pattern. It looks like this problem has happened to several people on this list in the past (see http://www.mail-archive.com/struts-user@jakarta.apache.org/msg10122.html , http://www.mail-archive.com/struts-user@jakarta.apache.org/msg07880.html , http://www.mail-archive.com/struts-user@jakarta.apache.org/msg03890.html ); however, no concrete answer for why the problem was occurring was posted. If anyone can tell me what they did to solve this problem, I'd greatly appreciate it. Unfortunately, I don't have the option of using this app with any of the other app servers that I've successfully used Struts with in the past. I'd be happy to update the Struts iPlanet installation page with any information I get. Thanks, -Greg- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re[2]: If several JSPs share the same action mapping...?
On Wednesday, June 12, 2002, 4:50:15 PM, Ted wrote: TH Each JSP can have its own action-mapping, and own input settings, and TH the rest of it, and all the action-mappings can share the same Action. Sorry if I was confusing, yes I meant JSPs sharing an action-mapping. I was trying to avoid having to write the same action-mapping over again for a few jsp's that are very similar and will end up fowarding to the same page after validation. The similar forms on each page will need to be validated though and I was just trying to find a good way to accomplish this but ran into a snag because the input has to be defined in the action-mapping that they would all share, so how would the validation know which page to return to if there were errors? TH Of course, action-mappings can also share JSPs, and so forth. There are TH no 1:1's here. TH -T. TH Rick Reumann wrote: Sorry James, I don't think I described the situation to well and I'm sure there probably is a better way to handle this... Easiest way is an extreme example.. What if you had 4 different JSPs that captured the same information in a form YET everything else on the page was radically different. Upon submission, though, you want to forward all the pages to the same Action and even possibly forward all of them to the same results page. The problem(I think) is you also want to validate the form information. I'm wondering how you would get the validation to know to return back to the correct JSP page if there were validation errors? I thought you needed to provide the input=yourJsp.jsp so that it knew were to go back to, but if all 4 jsps shared this action mapping what would you put in the input=? section? (maybe I'm totally wrong and the validation doesn't need that but I thought it did). Thanks for the help, Rick -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: If several JSPs share the same action mapping...?
The input property doesn't have to be a JSP. It could be another action. If that action had another way, besides the input property, to determine where to send control, it could return whatever ActionForward needed. One nasty kludge would be to put the name of the JSP into the file as a hidden property. The action would then know to look for that propery and could create an ActionForward back to it. You could also try looking at the refer header, but I don't know how reliable that would be. -T. Rick Reumann wrote: On Wednesday, June 12, 2002, 4:50:15 PM, Ted wrote: TH Each JSP can have its own action-mapping, and own input settings, and TH the rest of it, and all the action-mappings can share the same Action. Sorry if I was confusing, yes I meant JSPs sharing an action-mapping. I was trying to avoid having to write the same action-mapping over again for a few jsp's that are very similar and will end up fowarding to the same page after validation. The similar forms on each page will need to be validated though and I was just trying to find a good way to accomplish this but ran into a snag because the input has to be defined in the action-mapping that they would all share, so how would the validation know which page to return to if there were errors? TH Of course, action-mappings can also share JSPs, and so forth. There are TH no 1:1's here. TH -T. TH Rick Reumann wrote: Sorry James, I don't think I described the situation to well and I'm sure there probably is a better way to handle this... Easiest way is an extreme example.. What if you had 4 different JSPs that captured the same information in a form YET everything else on the page was radically different. Upon submission, though, you want to forward all the pages to the same Action and even possibly forward all of them to the same results page. The problem(I think) is you also want to validate the form information. I'm wondering how you would get the validation to know to return back to the correct JSP page if there were validation errors? I thought you needed to provide the input=yourJsp.jsp so that it knew were to go back to, but if all 4 jsps shared this action mapping what would you put in the input=? section? (maybe I'm totally wrong and the validation doesn't need that but I thought it did). Thanks for the help, Rick -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]