creating a class that extends Action Mapping...what is the purpose of it?
Hi, I was trying one struts example. In that example, it has created one class whcih extends ActionMapping class. I was just wondering why we need to create this class and when is it used and whether we define this class in struts-config or web.xml? Regards Deepak Saini _ Contact brides grooms FREE! Only on www.shaadi.com. http://www.shaadi.com/ptnr.php?ptnr=hmltag Register now! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: creating a class that extends Action Mapping...what is the purpose of it?
Sometime we need to add some info to struts mappings, and for this we use a class that extends ActionMapping. As an example, we need for a webapp to add a description to any mapping to build some stats. DescActionMapping defines a description attribute. every action-mapping in struts-config sets this property : action-mappings type=DescActionMapping action path=/login name=LoginForm input=error scope=request type=ConnexionAction set-property property=description value=Authentification/ forward name=success path=/accueil.do / forward name=error path=tiles:connexion / /action (...) Nico. Hi, I was trying one struts example. In that example, it has created one class whcih extends ActionMapping class. I was just wondering why we need to create this class and when is it used and whether we define this class in struts-config or web.xml? Regards Deepak Saini _ Contact brides grooms FREE! Only on www.shaadi.com. http://www.shaadi.com/ptnr.php?ptnr=hmltag Register now! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: creating a class that extends Action Mapping...what is the purpose of it?
I remember that this is done to use custom properties in your action mapping in the struts-config.xml file. action ... set-property property=foo value=x/ set-property property=bar value=y/ /action You can access them in your action. Mohan -Original Message- From: deepak saini [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 31, 2003 6:08 PM To: [EMAIL PROTECTED] Subject: creating a class that extends Action Mapping...what is the purpose of it? Hi, I was trying one struts example. In that example, it has created one class whcih extends ActionMapping class. I was just wondering why we need to create this class and when is it used and whether we define this class in struts-config or web.xml? Regards Deepak Saini _ Contact brides grooms FREE! Only on www.shaadi.com. http://www.shaadi.com/ptnr.php?ptnr=hmltag Register now! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DOTs, wild cards, and action mapping
David Friedman wrote: Thomas, (Probably a) Dumb question From the ${area.name} it looks like you're using Velocity Templates. I thought Velocity couldn't mix with JSP's like that (My impression from ch 17 of 'Struts in Action'. How are you mixing the two? (Or is there a Velocity update which allows it?) I should have noted that I am using tomcat 5.0 also. I am not using Velocity, but merely JSP EL. So no mixing. In debugging, the EL is returning the right thing. Struts is stripping the last .something assuming it is an extension. I guess barring any other comment I will just add a bogus extension to make sure I have no more conflicts. -Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DOTs, wild cards, and action mapping
I started using the wild-card support in action mappings (from a CVS build). It works, but I noticed something strange (until I realized what it was doing). So, I have a action mapping like: action path=/areas/* type=apackage.AreaAction forward name=success path=.area/ /action Then in some jsp I have: html:link title=${area.name} action=/areas/${area.address} Where area.address expands to '10.0.0.1'. Struts will look for the last dot in an action and chop it off. So I keep getting a string like: a href=/managearea/do/areas/10.0.0 title=area1area1/a So I am not using extensions in my struts configuration and I would intuitively think that I would get '10.0.0.1' back. Is this an ambiguity that appeared with the new wildcard support that cannot be resolved (meaning I should never use '.' in any names) or is there some way to resolve this? Perhaps I must always use extensions to combat this (i.e. action=/areas/${area.address}.bogus_extension - which is fine by me as a workaround)? -Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DOTs, wild cards, and action mapping
Thomas, (Probably a) Dumb question From the ${area.name} it looks like you're using Velocity Templates. I thought Velocity couldn't mix with JSP's like that (My impression from ch 17 of 'Struts in Action'. How are you mixing the two? (Or is there a Velocity update which allows it?) Regards, David -Original Message- From: Thomas E Enebo [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 17, 2003 7:16 PM To: [EMAIL PROTECTED] Subject: DOTs, wild cards, and action mapping I started using the wild-card support in action mappings (from a CVS build). It works, but I noticed something strange (until I realized what it was doing). So, I have a action mapping like: action path=/areas/* type=apackage.AreaAction forward name=success path=.area/ /action Then in some jsp I have: html:link title=${area.name} action=/areas/${area.address} Where area.address expands to '10.0.0.1'. Struts will look for the last dot in an action and chop it off. So I keep getting a string like: a href=/managearea/do/areas/10.0.0 title=area1area1/a So I am not using extensions in my struts configuration and I would intuitively think that I would get '10.0.0.1' back. Is this an ambiguity that appeared with the new wildcard support that cannot be resolved (meaning I should never use '.' in any names) or is there some way to resolve this? Perhaps I must always use extensions to combat this (i.e. action=/areas/${area.address}.bogus_extension - which is fine by me as a workaround)? -Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Action Mapping - without formbean
Hi All, I have a form with yes/no buttons. I want to use html:form tag but do not want to map to any Formbean. How can I do that? Thanks in advance. Kulkarni. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Mapping - without formbean
Hi Ravi The action attribute of your form tag points to the path for your action. By using this action path, Struts finds the action and then the form bean (subclass of ActionForm) (if any) associated with this action (through name attribute in struts-config.xml). So you can invoke your action without having a form bean. You could sniff the request object in your action to get the parameters and attributes passed along with the request. But why don't you just use a form bean for intercepting the results of pressing either the Yes or No button. IMO it is cleaner and done the Struts way. Sorry if I misunderstood your quuestion.. Regards Henrik - Original Message - From: Ravi Kulkarni [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 10:37 AM Subject: Action Mapping - without formbean Hi All, I have a form with yes/no buttons. I want to use html:form tag but do not want to map to any Formbean. How can I do that? Thanks in advance. Kulkarni. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action Mapping - without formbean
Thanks Henrik, that answers my question. -Original Message- From: HG [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 3:30 PM To: Struts Users Mailing List Subject: Re: Action Mapping - without formbean Hi Ravi The action attribute of your form tag points to the path for your action. By using this action path, Struts finds the action and then the form bean (subclass of ActionForm) (if any) associated with this action (through name attribute in struts-config.xml). So you can invoke your action without having a form bean. You could sniff the request object in your action to get the parameters and attributes passed along with the request. But why don't you just use a form bean for intercepting the results of pressing either the Yes or No button. IMO it is cleaner and done the Struts way. Sorry if I misunderstood your quuestion.. Regards Henrik - Original Message - From: Ravi Kulkarni [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 10:37 AM Subject: Action Mapping - without formbean Hi All, I have a form with yes/no buttons. I want to use html:form tag but do not want to map to any Formbean. How can I do that? Thanks in advance. Kulkarni. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Why the Action Mapping Cannot Be Retrieved?
I got this message in the browser: [ServletException in:/article/content/menu.jsp] Cannot retrieve mapping for action /do/editor/Category' The menu.jsp is a tile in my application. This is my tile menu.jsp: req:isUserInRole role=editor html:form action=/do/editor/Category TR TD class=option html:submit style=font: 10pt sans-serif White; background:Teal; width:130px; height:30pxView Articles/html:submit /TD /TR /html:form /req:isUserInRole If I change the statement that causes the ServletException to html:form action=editor/Category I got [ServletException in:/article/content/menu.jsp] Cannot retrieve definition for form bean null' However, I have no problem if menu.jsp is like: req:isUserInRole role=editor html:form action=/menu/Find TR TD class=option html:submit style=font: 10pt sans-serif White; background:Teal; width:130px; height:30pxView Articles/html:submit /TD /TR /html:form /req:isUserInRole The /menu/Find in my struts-config.xml is action path=/menu/Find type=org.apache.struts.scaffold.ParameterAction name=menuForm validate=false parameter=keyValue forward name=title path=/do/find/Property?keyName=titleamp;keyValue=/ forward name=author path=/do/find/Property?keyName=creatoramp;keyValue=/ forward name=journal_category path=/do/find/Property?keyName=journal_categoryamp;keyValue=/ forward name=content path=/do/find/Property?keyName=contentamp;keyValue=/ forward name=article path=/do/article/View?article=/ /action And, /editor/Category in my struts-config.xml is like: action path=/editor/Category type=org.apache.struts.scaffold.ProcessAction parameter=org.apache.artimus.article.EditorViewAction forward name=success path=/menu/Find/ /action __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Need help to create owm Custom Action Mapping to read the propertys
Hello everyone, I have to read a property when certain action is called. for simple mail application i want to read the smtp mailserver value from outside , i don't want to hard code it, for that I am creating my ActionMapping.And adding new tag called set-property for the action.but i am getting error when i start up the application. Here is my ActionMapping class package com.diginet.digichat.webapp.action; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionServlet; import org.apache.struts.config.ModuleConfig; import javax.servlet.ServletException; public class MailActionMapping extends ActionMapping { protected String mailserver; public MailActionMapping() { super(); } public void setMailServer(String mailserver) { this.mailserver = mailserver; } public String getMailServer() { return mailserver; } } The following are the changes i made to struts-config.xml action path=/Support type=com.diginet.digichat.webapp.action.SupportAction name=supportForm input=/support.jsp scope=request className=com.diginet.digichat.webapp.action.MailActionMapping set-property property=mailserver value=mail.digi-net.com / /action This is how i am using it in one of my classes MailActionMapping mailMapping = (MailActionMapping)mapping; smtpServerName = mailMapping.getMailServer(); These are the errors i am when i restart the Tomcat and goto the application org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) root cause javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533) at org.apache.jsp.logon_jsp._jspService(logon_jsp.java:81) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210) I also tried using the PlugIn but it is not working with that too. I been trying this from last two days please someone advice me what i am doing wrong. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need help to create owm Custom Action Mapping to read the pro pertys
Archana, afaik, your struts config.xml should look like: action path=/Support type=com.diginet.digichat.webapp.action.MailActionMapping name=supportForm input=/support.jsp scope=request set-property property=mailserver value=mail.digi-net.com / /action where your type is your qualified class name. try that. cheers, Fred -Original Message- From: Archana Annamaneni [mailto:[EMAIL PROTECTED] Sent: 20 October 2003 17:00 To: [EMAIL PROTECTED] Subject: Need help to create owm Custom Action Mapping to read the propertys Hello everyone, I have to read a property when certain action is called. for simple mail application i want to read the smtp mailserver value from outside , i don't want to hard code it, for that I am creating my ActionMapping.And adding new tag called set-property for the action.but i am getting error when i start up the application. Here is my ActionMapping class package com.diginet.digichat.webapp.action; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionServlet; import org.apache.struts.config.ModuleConfig; import javax.servlet.ServletException; public class MailActionMapping extends ActionMapping { protected String mailserver; public MailActionMapping() { super(); } public void setMailServer(String mailserver) { this.mailserver = mailserver; } public String getMailServer() { return mailserver; } } The following are the changes i made to struts-config.xml action path=/Support type=com.diginet.digichat.webapp.action.SupportAction name=supportForm input=/support.jsp scope=request className=com.diginet.digichat.webapp.action.MailActionMapping set-property property=mailserver value=mail.digi-net.com / /action This is how i am using it in one of my classes MailActionMapping mailMapping = (MailActionMapping)mapping; smtpServerName = mailMapping.getMailServer(); These are the errors i am when i restart the Tomcat and goto the application org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) root cause javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:533) at org.apache.jsp.logon_jsp._jspService(logon_jsp.java:81) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 10) I also tried using the PlugIn but it is not working with that too. I been trying this from last two days please someone advice me what i am doing wrong. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** Tokyo-Mitsubishi International plc ('TMI') is registered in England, company number 1698498. TMI's registered office is 6 Broadgate, London EC2M 2AA. TMI is a wholly owned subsidiary of The Bank of Tokyo-Mitsubishi, Ltd and is regulated by the Financial Services Authority. This message is intended solely for the individual addressee named above. The information contained in this E-Mail is confidential and may be legally privileged. If you are not the intended recipient please delete in its entirety. Messages sent via this medium may be subject to delays, non-delivery and unauthorised alteration. The information contained herein or attached hereto has been obtained from sources we believe to be reliable but we do not represent that it is accurate or complete. Any reference to past performance should not be taken as an indication of future performance. The information contained herein or attached hereto is not to be construed as an offer or solicitation to buy or sell any security, instrument or investment. TMI or any affiliated company, may have an interest, position, or effect transactions, in any investment mentioned herein. Any opinions or recommendations expressed herein are solely those of the author or analyst and are subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need help to create owm Custom Action Mapping to read the pro pertys
Thank you Fred for the reply.But i am still getting the same error. action path=/Support type=com.diginet.digichat.webapp.action.SupportAction name=supportForm input=/support.jsp scope=request className=com.diginet.digichat.webapp.action.MailActionMapping set-property property=mailserver value=mail.digi-net.com / /action But I also think I need both the type and className because in SuuportAction class a I am using the MailActionMapping which has the mailserver property defined.This I got from the book Mastering jakartha Struts and also on the web. I don't know somehow that set-property is causing the problem , because if I delete that line from action everything works fine though I can not read the property. Thank you Archana On Mon, 2003-10-20 at 11:59, Fred Tsang wrote: Archana, afaik, your struts config.xml should look like: action path=/Support type=com.diginet.digichat.webapp.action.MailActionMapping name=supportForm input=/support.jsp scope=request set-property property=mailserver value=mail.digi-net.com / /action where your type is your qualified class name. try that. cheers, Fred -Original Message- From: Archana Annamaneni [mailto:[EMAIL PROTECTED] Sent: 20 October 2003 17:00 To: [EMAIL PROTECTED] Subject: Need help to create owm Custom Action Mapping to read the propertys Hello everyone, I have to read a property when certain action is called. for simple mail application i want to read the smtp mailserver value from outside , i don't want to hard code it, for that I am creating my ActionMapping.And adding new tag called set-property for the action.but i am getting error when i start up the application. Here is my ActionMapping class package com.diginet.digichat.webapp.action; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionServlet; import org.apache.struts.config.ModuleConfig; import javax.servlet.ServletException; public class MailActionMapping extends ActionMapping { protected String mailserver; public MailActionMapping() { super(); } public void setMailServer(String mailserver) { this.mailserver = mailserver; } public String getMailServer() { return mailserver; } } The following are the changes i made to struts-config.xml action path=/Support type=com.diginet.digichat.webapp.action.SupportAction name=supportForm input=/support.jsp scope=request className=com.diginet.digichat.webapp.action.MailActionMapping set-property property=mailserver value=mail.digi-net.com / /action This is how i am using it in one of my classes MailActionMapping mailMapping = (MailActionMapping)mapping; smtpServerName = mailMapping.getMailServer(); These are the errors i am when i restart the Tomcat and goto the application org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) root cause javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:533) at org.apache.jsp.logon_jsp._jspService(logon_jsp.java:81) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 10) I also tried using the PlugIn but it is not working with that too. I been trying this from last two days please someone advice me what i am doing wrong. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** Tokyo-Mitsubishi International plc ('TMI') is registered in England, company number 1698498. TMI's registered office is 6 Broadgate, London EC2M 2AA. TMI is a wholly owned subsidiary of The Bank of Tokyo-Mitsubishi, Ltd and is regulated by the Financial Services Authority. This message is intended solely for the individual addressee named above. The information contained in this E-Mail is confidential and may be legally privileged. If you are not the intended recipient please delete in its entirety. Messages sent via this medium may be subject to delays, non-delivery and unauthorised alteration. The information contained herein or attached hereto has been obtained from sources we believe to be reliable but we do not represent that it is accurate or complete. Any reference to past performance should not be taken as an indication
Re: How To Work Out This Action Mapping?
Caroline Jen wrote: To answer your questions: 1. The LOGON button links to a forward: html:link forward=logonLOGON/html:link and in my struts-config.xml, I have forward name=logon path=/do/admin/Menu/ Well, that's the first problem ... security constraints are only applied on an original request from the client, not on a forward. You'll need to add redirect=true to this, in order to get the client to request it. 2. the security-constraint in my web-xml is: security-constraint web-resource-collection web-resource-nameAdministrative/web-resource-name !-- The URLs to protect -- url-pattern/do/admin/*/url-pattern /web-resource-collection auth-constraint !-- The authorized users -- role-nameadministrator/role-name role-namecontributor/role-name /auth-constraint /security-constraint By the way, there is another problem -- after the insertion of the security-constraint, the application totally stops functioning. No welcome page displayed. In the browser, I have HTTP Status 404 -/PracticeVersion description: The requested resource(/PracticeVersion) is not availabe. and in the Tomcat log file, I have: LifecycleException: Container StandardContext[/PracticeVersion] has not been started That means you did not obey the required element order in the web.xml file. You'll undoubtedly see a stack trace in the log files that talks about an XML parsing error. The correct order is defined by the DTD for web.xml files. Among other places, you'll find a copy of the DTDs for Servlet 2.2 and Servlet 2.3 in the lib directory of your Struts distribution. Open either web_app_2_2.dtd or web_app_2_3.dtd (depending on which version you're using) and look for the line that starts !ELEMENT webapp The list of element names in parentheses is the required order for elements in your own web.xml files. Thereafter, I deleted the security-constraint element from the web.xml file. I have the welcome page displayed. After I click on the LOGON button in the welcome page, the welcome page remains in the browser. The logon.jsp, which collects j-username, j_password, does not get displayed and http://localhost:8080/PracticeVersion/do/admin/Menu shows in the address bar. Change your forward to add redirect=true and put the security constraint in the correct order, and you should be good to go. --Caroline Craig --- Craig R. McClanahan [EMAIL PROTECTED] wrote: Caroline Jen wrote: Thank you very much for the detailed explanation. Yet, I still have hard time to make my application work -- I am able to display the welcome page (no problem). And I have http://localhost:8080/PracticeVersion/do/Menu;jsessionid=0A6E76A8F3E849BC8DAAC45BFB72F72E in the address bar. However, after I click on the LOGON button in the welcome page, the welcome page Where does this LOGON button submit to? If it submits to j_security_check, you are doing this wrong. It should submit to some resource that is protected by a security constraint. remains in the browser. The logon.jsp, which collects j-username, j_passwor, does not get displayed and http://localhost:8080/PracticeVersion/do/admin/Menu shows in the address bar. I do not know what went wrong. Could it be that the JDBCRealm is not configured correctly? Because the LOGON button links to a forward: html:link forward=logonLOGON/html:link and in my struts-config.xml, I have forward name=logon path=/do/admin/Menu/ The /do/admin/Menu is my protected resources. I keep it unchanged. It's only protected if it's listed in a security-constraint in web.xml. 1. I configured the Tomcat JDBCRealm and prepared the users table, user-roles table according the instructions found at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html Which Realm you use does not make any difference. 2. Because I want to use FORM based container managed authentication, I inserted login-config auth-methodFORM/auth-method form-login-config form-login-page/signin/logon.jsp/form-login-page form-error-page/signin/logon.jsp?error=true/form-error-page /form-login-config /login-config in the web.xml file. What does your security-constraint in web.xml look like? This is the critical ingredient. 3. I put logon.jsp in the ApplicationRoot/signin folder. Here is the code of the logon.jsp (I took out all the Struts tags) and I know the code works well because I have tested it: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTML HEAD TITLEContainer Managed Authentication/TITLE /HEAD BODY H1Sign in, Please/H1 HR FORM action=j_security_check method=post focus=j_username TABLE border=0 width=50% cellspacing=3 cellpadding=2 TR TH align=rightUser Name:/TH TD align=leftINPUT TYPE=text
Re: How To Work Out This Action Mapping?
Craig, thank you for your very strong support in the past day or two to guide me through problems with the container-managed authentication. I looked at my web.xml file again and again. There is nothing wrong with the order of the elements in that file. And there is no stack trace in the log files that talks about an XML parsing error. I did some experiments. I found that as long as I have the JDBCRealm in the $TOMCAT_HOME/conf/server.xml, the Tomcat does not accept security-constraint element in the application's web.xml file. And the Tomcat gives me the required resouce /MyApplication is not availabel HTTP Status 404. Have you seen this kind of problem before? I have posted the question at the tomcat-user discussion forum. --Caroline --- Craig R. McClanahan [EMAIL PROTECTED] wrote: Caroline Jen wrote: To answer your questions: 1. The LOGON button links to a forward: html:link forward=logonLOGON/html:link and in my struts-config.xml, I have forward name=logon path=/do/admin/Menu/ Well, that's the first problem ... security constraints are only applied on an original request from the client, not on a forward. You'll need to add redirect=true to this, in order to get the client to request it. 2. the security-constraint in my web-xml is: security-constraint web-resource-collection web-resource-nameAdministrative/web-resource-name !-- The URLs to protect -- url-pattern/do/admin/*/url-pattern /web-resource-collection auth-constraint !-- The authorized users -- role-nameadministrator/role-name role-namecontributor/role-name /auth-constraint /security-constraint By the way, there is another problem -- after the insertion of the security-constraint, the application totally stops functioning. No welcome page displayed. In the browser, I have HTTP Status 404 -/PracticeVersion description: The requested resource(/PracticeVersion) is not availabe. and in the Tomcat log file, I have: LifecycleException: Container StandardContext[/PracticeVersion] has not been started That means you did not obey the required element order in the web.xml file. You'll undoubtedly see a stack trace in the log files that talks about an XML parsing error. The correct order is defined by the DTD for web.xml files. Among other places, you'll find a copy of the DTDs for Servlet 2.2 and Servlet 2.3 in the lib directory of your Struts distribution. Open either web_app_2_2.dtd or web_app_2_3.dtd (depending on which version you're using) and look for the line that starts !ELEMENT webapp The list of element names in parentheses is the required order for elements in your own web.xml files. Thereafter, I deleted the security-constraint element from the web.xml file. I have the welcome page displayed. After I click on the LOGON button in the welcome page, the welcome page remains in the browser. The logon.jsp, which collects j-username, j_password, does not get displayed and http://localhost:8080/PracticeVersion/do/admin/Menu shows in the address bar. Change your forward to add redirect=true and put the security constraint in the correct order, and you should be good to go. --Caroline Craig --- Craig R. McClanahan [EMAIL PROTECTED] wrote: Caroline Jen wrote: Thank you very much for the detailed explanation. Yet, I still have hard time to make my application work -- I am able to display the welcome page (no problem). And I have http://localhost:8080/PracticeVersion/do/Menu;jsessionid=0A6E76A8F3E849BC8DAAC45BFB72F72E in the address bar. However, after I click on the LOGON button in the welcome page, the welcome page Where does this LOGON button submit to? If it submits to j_security_check, you are doing this wrong. It should submit to some resource that is protected by a security constraint. remains in the browser. The logon.jsp, which collects j-username, j_passwor, does not get displayed and http://localhost:8080/PracticeVersion/do/admin/Menu shows in the address bar. I do not know what went wrong. Could it be that the JDBCRealm is not configured correctly? Because the LOGON button links to a forward: html:link forward=logonLOGON/html:link and in my struts-config.xml, I have forward name=logon path=/do/admin/Menu/ The /do/admin/Menu is my protected resources. I keep it unchanged. It's only protected if it's listed in a security-constraint in web.xml. 1. I configured the Tomcat JDBCRealm and prepared the users table, user-roles table according the instructions found at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html
How To Work Out This Action Mapping?
Because there is such a statement (shown below) in my signinForm.jsp: html:form action=j_security_check method=post focus=j_username I put action name=j_security_check path=/do/admin/Menu/ in my struts-config.xml file. When I ran the application, I got: [ServletException in:/article/content/signinForm.jsp] Cannot retrieve mapping for action /j_security_check' I know that I did not specify the action properly. What is the correct way to do it? __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How To Work Out This Action Mapping?
I think you may be doing two things wrong: 1. j_security_check is a special URL. If you have a security realm defined in your web application, and authentication method specified as FORM, then the container will automatically forward any requests for protected resources to a configurable login form. This login form collects the username and password, and posts to this special URL; the post to j_security_check gets intercepted by your servlet container, which performs Container Managed Authentication - it looks for the j_username and j_password, authenticates the combination, and forwards to the originally requested resource, or to a configurable error page if the authentication fails. All this to say that you can not map an action to j_security_check. Furthermore, you can't even aggressively authenticate using CMA (Container Managed Authentication) - if you go directly to your login page (without being forwarded there by you container), and try to submit the form, you'll get an error. 2. If you were trying to map a legitimate URL, then you'd have your action properties wrong. action path=/someLegitimatePath type=your.action.class name=name of a previously defined ActionForm if needed for this action /action HTH, -Sasha On 10/10/03 20:21, Caroline Jen [EMAIL PROTECTED] wrote: Because there is such a statement (shown below) in my signinForm.jsp: html:form action=j_security_check method=post focus=j_username I put action name=j_security_check path=/do/admin/Menu/ in my struts-config.xml file. When I ran the application, I got: [ServletException in:/article/content/signinForm.jsp] Cannot retrieve mapping for action /j_security_check' I know that I did not specify the action properly. What is the correct way to do it? __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How To Work Out This Action Mapping?
Thank you for your reply. I am using container managed authentication. My problem is how to go from j_security_check back to my Struts framework. I have my Tomcat JDBCRealm configured and users, user_roles tables prepared in the database. In my struts-config.xml file, I did this forward when users click on the LOGON button: forward name=logon path=/signin/logon.jsp/ and in my web.xml file, I have: login-config auth-methodFORM/auth-method form-login-config form-login-page/signin/logon.jsp/form-login-page form-error-page/signin/logon.jsp?error=true/form-error-page /form-login-config /login-config The Tomcat server found the signinForm.jsp through the /signin/logon.jsp without problem. and my signinForm.jsp is correctly prepared: %@ taglib uri=/tags/struts-html prefix=html % HTML HEAD TITLEContainer Managed Authentication/TITLE /HEAD BODY html:errors/ html:form action=j_security_check method=post focus=j_username TABLE border=0 width=100% TR TH align=rightUser Name:/TH TD align=lefthtml:text property=j_username size=25//TD /TR TR TH align=rightPassword:/TH TD align=lefthtml:password property=j_password size=10//TD /TR TR TD align=righthtml:submit//TD TD align=lefthtml:reset//TD /TR /TABLE /html:form /BODY /HTML --Caroline --- Sasha Borodin [EMAIL PROTECTED] wrote: I think you may be doing two things wrong: 1. j_security_check is a special URL. If you have a security realm defined in your web application, and authentication method specified as FORM, then the container will automatically forward any requests for protected resources to a configurable login form. This login form collects the username and password, and posts to this special URL; the post to j_security_check gets intercepted by your servlet container, which performs Container Managed Authentication - it looks for the j_username and j_password, authenticates the combination, and forwards to the originally requested resource, or to a configurable error page if the authentication fails. All this to say that you can not map an action to j_security_check. Furthermore, you can't even aggressively authenticate using CMA (Container Managed Authentication) - if you go directly to your login page (without being forwarded there by you container), and try to submit the form, you'll get an error. 2. If you were trying to map a legitimate URL, then you'd have your action properties wrong. action path=/someLegitimatePath type=your.action.class name=name of a previously defined ActionForm if needed for this action /action HTH, -Sasha On 10/10/03 20:21, Caroline Jen [EMAIL PROTECTED] wrote: Because there is such a statement (shown below) in my signinForm.jsp: html:form action=j_security_check method=post focus=j_username I put action name=j_security_check path=/do/admin/Menu/ in my struts-config.xml file. When I ran the application, I got: [ServletException in:/article/content/signinForm.jsp] Cannot retrieve mapping for action /j_security_check' I know that I did not specify the action properly. What is the correct way to do it? __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How To Work Out This Action Mapping?
Caroline Jen wrote: Thank you for your reply. I am using container managed authentication. My problem is how to go from j_security_check back to my Struts framework. That turns out to not be your problem ... that is the container's problem. The key thing to remember is that the user should never access your login page (whatever it's URL is) directly. Instead, form-based login is triggered the first time that an unauthenticated user requests a URL that is protected by a security constraint. What happens next goes like this: (1) Unauthenticated user requests a protected resource (*NOT* the login page!) (2) Container remembers the protected resource that was requested in a private variable. (3) Container displays the login page, which must have a destination of j_security_check, and waits for the user submit. For some containers, including Tomcat, this is the one-and-only time that submitting to j_security_check will not return a 404. (4) User enters username and password, and presses the submit button. (5) Container authenticates the username and password combination. If valid, container recalls the resource saved in (2) and displays *that* to the user in response to the login submit. If this doesn't make sense, temporarily switch your app to use BASIC authentication instead, and walk through the process. The user experience will be identical except that the login page will be a popup dialog box instead of your configured login page. (Technically, it's different in one other respect -- it's the *browser* that does the remembering in step (2) and the restoring in step (5), but the user doesn't know that). The important point is that, at no time, did anyone ever submit a request to the URL of the login page, because there is no such thing when using BASIC authentication. You should pretend there is no such thing when using form based login, also; think of the login page as part of the container, not part of your app. In answer to your original question, the simplest thing to do on a login page is just use the standard HTML form element instead of the Struts html:form tag. Then, you can just say: form method=POST action=j_security_check ... /form Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How To Work Out This Action Mapping?
Thank you very much for the detailed explanation. Yet, I still have hard time to make my application work -- I am able to display the welcome page (no problem). And I have http://localhost:8080/PracticeVersion/do/Menu;jsessionid=0A6E76A8F3E849BC8DAAC45BFB72F72E in the address bar. However, after I click on the LOGON button in the welcome page, the welcome page remains in the browser. The logon.jsp, which collects j-username, j_passwor, does not get displayed and http://localhost:8080/PracticeVersion/do/admin/Menu shows in the address bar. I do not know what went wrong. Could it be that the JDBCRealm is not configured correctly? Because the LOGON button links to a forward: html:link forward=logonLOGON/html:link and in my struts-config.xml, I have forward name=logon path=/do/admin/Menu/ The /do/admin/Menu is my protected resources. I keep it unchanged. 1. I configured the Tomcat JDBCRealm and prepared the users table, user-roles table according the instructions found at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html 2. Because I want to use FORM based container managed authentication, I inserted login-config auth-methodFORM/auth-method form-login-config form-login-page/signin/logon.jsp/form-login-page form-error-page/signin/logon.jsp?error=true/form-error-page /form-login-config /login-config in the web.xml file. 3. I put logon.jsp in the ApplicationRoot/signin folder. Here is the code of the logon.jsp (I took out all the Struts tags) and I know the code works well because I have tested it: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTML HEAD TITLEContainer Managed Authentication/TITLE /HEAD BODY H1Sign in, Please/H1 HR FORM action=j_security_check method=post focus=j_username TABLE border=0 width=50% cellspacing=3 cellpadding=2 TR TH align=rightUser Name:/TH TD align=leftINPUT TYPE=text NAME=j_username SIZE=25//TD /TR TR TH align=rightPassword:/TH TD align=leftINPUT TYPE=password NAME=j_password SIZE=10//TD /TR TR TD align=rightINPUT TYPE=submit VALUE=Submit/TD TD align=leftINPUT TYPE=reset VALUE=Reset/TD /TR /TABLE /FORM /BODY --Caroline --- Craig R. McClanahan [EMAIL PROTECTED] wrote: Caroline Jen wrote: Thank you for your reply. I am using container managed authentication. My problem is how to go from j_security_check back to my Struts framework. That turns out to not be your problem ... that is the container's problem. The key thing to remember is that the user should never access your login page (whatever it's URL is) directly. Instead, form-based login is triggered the first time that an unauthenticated user requests a URL that is protected by a security constraint. What happens next goes like this: (1) Unauthenticated user requests a protected resource (*NOT* the login page!) (2) Container remembers the protected resource that was requested in a private variable. (3) Container displays the login page, which must have a destination of j_security_check, and waits for the user submit. For some containers, including Tomcat, this is the one-and-only time that submitting to j_security_check will not return a 404. (4) User enters username and password, and presses the submit button. (5) Container authenticates the username and password combination. If valid, container recalls the resource saved in (2) and displays *that* to the user in response to the login submit. If this doesn't make sense, temporarily switch your app to use BASIC authentication instead, and walk through the process. The user experience will be identical except that the login page will be a popup dialog box instead of your configured login page. (Technically, it's different in one other respect -- it's the *browser* that does the remembering in step (2) and the restoring in step (5), but the user doesn't know that). The important point is that, at no time, did anyone ever submit a request to the URL of the login page, because there is no such thing when using BASIC authentication. You should pretend there is no such thing when using form based login, also; think of the login page as part of the container, not part of your app. In answer to your original question, the simplest thing to do on a login page is just use the standard HTML form element instead of the Struts html:form tag. Then, you can just say: form method=POST action=j_security_check ... /form Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail:
Re: How To Work Out This Action Mapping?
Caroline Jen wrote: Thank you very much for the detailed explanation. Yet, I still have hard time to make my application work -- I am able to display the welcome page (no problem). And I have http://localhost:8080/PracticeVersion/do/Menu;jsessionid=0A6E76A8F3E849BC8DAAC45BFB72F72E in the address bar. However, after I click on the LOGON button in the welcome page, the welcome page Where does this LOGON button submit to? If it submits to j_security_check, you are doing this wrong. It should submit to some resource that is protected by a security constraint. remains in the browser. The logon.jsp, which collects j-username, j_passwor, does not get displayed and http://localhost:8080/PracticeVersion/do/admin/Menu shows in the address bar. I do not know what went wrong. Could it be that the JDBCRealm is not configured correctly? Because the LOGON button links to a forward: html:link forward=logonLOGON/html:link and in my struts-config.xml, I have forward name=logon path=/do/admin/Menu/ The /do/admin/Menu is my protected resources. I keep it unchanged. It's only protected if it's listed in a security-constraint in web.xml. 1. I configured the Tomcat JDBCRealm and prepared the users table, user-roles table according the instructions found at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html Which Realm you use does not make any difference. 2. Because I want to use FORM based container managed authentication, I inserted login-config auth-methodFORM/auth-method form-login-config form-login-page/signin/logon.jsp/form-login-page form-error-page/signin/logon.jsp?error=true/form-error-page /form-login-config /login-config in the web.xml file. What does your security-constraint in web.xml look like? This is the critical ingredient. 3. I put logon.jsp in the ApplicationRoot/signin folder. Here is the code of the logon.jsp (I took out all the Struts tags) and I know the code works well because I have tested it: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTML HEAD TITLEContainer Managed Authentication/TITLE /HEAD BODY H1Sign in, Please/H1 HR FORM action=j_security_check method=post focus=j_username TABLE border=0 width=50% cellspacing=3 cellpadding=2 TR TH align=rightUser Name:/TH TD align=leftINPUT TYPE=text NAME=j_username SIZE=25//TD /TR TR TH align=rightPassword:/TH TD align=leftINPUT TYPE=password NAME=j_password SIZE=10//TD /TR TR TD align=rightINPUT TYPE=submit VALUE=Submit/TD TD align=leftINPUT TYPE=reset VALUE=Reset/TD /TR /TABLE /FORM /BODY --Caroline Craig --- Craig R. McClanahan [EMAIL PROTECTED] wrote: Caroline Jen wrote: Thank you for your reply. I am using container managed authentication. My problem is how to go from j_security_check back to my Struts framework. That turns out to not be your problem ... that is the container's problem. The key thing to remember is that the user should never access your login page (whatever it's URL is) directly. Instead, form-based login is triggered the first time that an unauthenticated user requests a URL that is protected by a security constraint. What happens next goes like this: (1) Unauthenticated user requests a protected resource (*NOT* the login page!) (2) Container remembers the protected resource that was requested in a private variable. (3) Container displays the login page, which must have a destination of j_security_check, and waits for the user submit. For some containers, including Tomcat, this is the one-and-only time that submitting to j_security_check will not return a 404. (4) User enters username and password, and presses the submit button. (5) Container authenticates the username and password combination. If valid, container recalls the resource saved in (2) and displays *that* to the user in response to the login submit. If this doesn't make sense, temporarily switch your app to use BASIC authentication instead, and walk through the process. The user experience will be identical except that the login page will be a popup dialog box instead of your configured login page. (Technically, it's different in one other respect -- it's the *browser* that does the remembering in step (2) and the restoring in step (5), but the user doesn't know that). The important point is that, at no time, did anyone ever submit a request to the URL of the login page, because there is no such thing when using BASIC authentication. You should pretend there is no such thing when using form based login, also; think of the login page as part of the container, not part of your app. In answer to your original question, the simplest thing to do on a login page is just use the standard HTML form element instead of the Struts html:form tag. Then, you can just say: form method=POST action=j_security_check ... /form Craig
Re: How To Work Out This Action Mapping?
To answer your questions: 1. The LOGON button links to a forward: html:link forward=logonLOGON/html:link and in my struts-config.xml, I have forward name=logon path=/do/admin/Menu/ 2. the security-constraint in my web-xml is: security-constraint web-resource-collection web-resource-nameAdministrative/web-resource-name !-- The URLs to protect -- url-pattern/do/admin/*/url-pattern /web-resource-collection auth-constraint !-- The authorized users -- role-nameadministrator/role-name role-namecontributor/role-name /auth-constraint /security-constraint By the way, there is another problem -- after the insertion of the security-constraint, the application totally stops functioning. No welcome page displayed. In the browser, I have HTTP Status 404 -/PracticeVersion description: The requested resource(/PracticeVersion) is not availabe. and in the Tomcat log file, I have: LifecycleException: Container StandardContext[/PracticeVersion] has not been started Thereafter, I deleted the security-constraint element from the web.xml file. I have the welcome page displayed. After I click on the LOGON button in the welcome page, the welcome page remains in the browser. The logon.jsp, which collects j-username, j_password, does not get displayed and http://localhost:8080/PracticeVersion/do/admin/Menu shows in the address bar. --Caroline --- Craig R. McClanahan [EMAIL PROTECTED] wrote: Caroline Jen wrote: Thank you very much for the detailed explanation. Yet, I still have hard time to make my application work -- I am able to display the welcome page (no problem). And I have http://localhost:8080/PracticeVersion/do/Menu;jsessionid=0A6E76A8F3E849BC8DAAC45BFB72F72E in the address bar. However, after I click on the LOGON button in the welcome page, the welcome page Where does this LOGON button submit to? If it submits to j_security_check, you are doing this wrong. It should submit to some resource that is protected by a security constraint. remains in the browser. The logon.jsp, which collects j-username, j_passwor, does not get displayed and http://localhost:8080/PracticeVersion/do/admin/Menu shows in the address bar. I do not know what went wrong. Could it be that the JDBCRealm is not configured correctly? Because the LOGON button links to a forward: html:link forward=logonLOGON/html:link and in my struts-config.xml, I have forward name=logon path=/do/admin/Menu/ The /do/admin/Menu is my protected resources. I keep it unchanged. It's only protected if it's listed in a security-constraint in web.xml. 1. I configured the Tomcat JDBCRealm and prepared the users table, user-roles table according the instructions found at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html Which Realm you use does not make any difference. 2. Because I want to use FORM based container managed authentication, I inserted login-config auth-methodFORM/auth-method form-login-config form-login-page/signin/logon.jsp/form-login-page form-error-page/signin/logon.jsp?error=true/form-error-page /form-login-config /login-config in the web.xml file. What does your security-constraint in web.xml look like? This is the critical ingredient. 3. I put logon.jsp in the ApplicationRoot/signin folder. Here is the code of the logon.jsp (I took out all the Struts tags) and I know the code works well because I have tested it: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTML HEAD TITLEContainer Managed Authentication/TITLE /HEAD BODY H1Sign in, Please/H1 HR FORM action=j_security_check method=post focus=j_username TABLE border=0 width=50% cellspacing=3 cellpadding=2 TR TH align=rightUser Name:/TH TD align=leftINPUT TYPE=text NAME=j_username SIZE=25//TD /TR TR TH align=rightPassword:/TH TD align=leftINPUT TYPE=password NAME=j_password SIZE=10//TD /TR TR TD align=rightINPUT TYPE=submit VALUE=Submit/TD TD align=leftINPUT TYPE=reset VALUE=Reset/TD /TR /TABLE /FORM /BODY --Caroline Craig --- Craig R. McClanahan [EMAIL PROTECTED] wrote: Caroline Jen wrote: Thank you for your reply. I am using container managed authentication. My problem is how to go from j_security_check back to my Struts framework. That turns out to not be your problem ... that is the container's problem. The key thing to remember is that the user should never access your login page (whatever it's URL is) directly. Instead, form-based login is triggered the first time that an unauthenticated user requests a URL that is protected by a security constraint. What happens next goes like this: (1) Unauthenticated user requests a protected resource (*NOT* the login page!)
Re: Confused - Scaffold and Action Mapping
1. The .article.Menu tile uses the menuForm bean. 2. Check the import statement at the top of the file =:0) It's just a static String. HTH, Ted. Caroline Jen wrote: I have problem to understand the action mapping shown below: code: - action path=/Menu name=menuForm type=org.apache.struts.scaffold.ExistsAttributeAction parameter=application;HOURS forward name=success path=.article.Menu/ forward name=failure path=/do/MenuCreate/ /action - It looks to me that 1. menuForm is the logical name for the form bean as given in the form-bean segment of the struts-config.xml file. Question 1: What is the rational of having 'menuForm' in the org.apache.struts.scaffold folder in ActionMapping? 2. the action that is going to be executed is the ExistsAttributeAction in the org.apache.struts.scaffold folder. If the condition returned in that action is 'success', the article.Menu tile will render the next page. The code of ExistsAttributeAction.java shows: mapping.findForward(Tokens.SUCCESS); Question 2: Where can I find Tokens.SUCCESS maps to 'success'? Thank you for your help. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: derrive the form action name from the action mapping that called the JSP
I don't believe you can... What I end up doing is make the form submit to a common dispatch action that then forwards to either action1 or action2... daniel - Original Message - From: Mick Knutson [EMAIL PROTECTED] To: struts [EMAIL PROTECTED] Sent: Tuesday, September 16, 2003 7:22 PM Subject: derrive the form action name from the action mapping that called the JSP Is it possible to derive the form action name from the action mapping that called the JSP? Like: html:form action=${actionName} method=post I have 2 different actions that calls a JSP page. I want each of them to submit to the respective action I.e action1 gets submitted to action1.do, and action2 get submitted to action2.do Is this possible? --- Thanks Mick Knutson http://www.baselogic.com +001(805) 563-0666 Office +001 (708) 570-2772 Fax --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Confused - Scaffold and Action Mapping
I have problem to understand the action mapping shown below: code: - action path=/Menu name=menuForm type=org.apache.struts.scaffold.ExistsAttributeAction parameter=application;HOURS forward name=success path=.article.Menu/ forward name=failure path=/do/MenuCreate/ /action - It looks to me that 1. menuForm is the logical name for the form bean as given in the form-bean segment of the struts-config.xml file. Question 1: What is the rational of having 'menuForm' in the org.apache.struts.scaffold folder in ActionMapping? 2. the action that is going to be executed is the ExistsAttributeAction in the org.apache.struts.scaffold folder. If the condition returned in that action is 'success', the article.Menu tile will render the next page. The code of ExistsAttributeAction.java shows: mapping.findForward(Tokens.SUCCESS); Question 2: Where can I find Tokens.SUCCESS maps to 'success'? Thank you for your help. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
derrive the form action name from the action mapping that called the JSP
Is it possible to derive the form action name from the action mapping that called the JSP? Like: html:form action=${actionName} method=post I have 2 different actions that calls a JSP page. I want each of them to submit to the respective action I.e action1 gets submitted to action1.do, and action2 get submitted to action2.do Is this possible? --- Thanks Mick Knutson http://www.baselogic.com +001(805) 563-0666 Office +001 (708) 570-2772 Fax --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: One form multiple Action mapping
Hey you can do some thing like this. c:if test=${TechnologyForm.action == 'CREATE'} c:set var=action value=/CreateTechnology.do / /c:if c:if test=${TechnologyForm.action == 'SUBMITTED'} c:set var=action value=/TechnologyList.do / /c:if c:if test=${TechnologyForm.action == 'MODIFY'} c:set var=action value=/UpdateTechnology.do / /c:if html-el:form styleId=Body action=${action} onsubmit=return submitForm() -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 8:49 PM To: 'Struts Users Mailing List' Subject: RE: One form multiple Action mapping Come to think of it more, since I want the submitted form to use different action mappings, I thought of using something like Scanfold's RelayAction which dispatches to different action mappings based on the parameter (in my case 'method'). On each action mapping I could set my required roles etc. and then have them all forwarded to the RegistrationAction for processing. This way I can distinguish between them and still process them in a single point (Action). What do you think? Erez -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 4:03 PM To: 'Struts Users Mailing List' Subject: RE: One form multiple Action mapping What about: html:form action=/Reg.do c:if ... html:hidden property=method value=dispatchMeth1 / /c:if c:otherwise html:hidden property=method value=dispatchMeth2 / /c:otherwise /html:form -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 11:04 AM To: 'Struts Users Mailing List' Subject: One form multiple Action mapping I have a registration form (RegForm) which based on the method/mode I want to direct it to a different action mapping in order to assign different roles or security restrictions. I have a single RegAction extending the DispatchAction class, with parameter 'method' as the dispatch parameter. I thought of maybe put a c:if .. and based on the 'method' put the correct html:form .. one. But then again maybe this will harm the javascript validation, cause the name of the form will be different. How can this be done? Registration.jsp: html:form action=/Reg.do?method=create ... /html:form Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: action-mapping forward - how do I use it?
How about a little javascript snippet on that button that submits it? That way it will not submit as a form... -Original Message- From: David Thielen [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 27, 2003 3:56 PM To: Struts-Users Subject: action-mapping forward - how do I use it? Hi; I have a case where, when the user clicks on a button, I want the action to be to go to a new page. No ActionServlet or ActionForm because the only thing in the form is the button. But I would like to use the action-mapping to determine where to go. I tried to do this with: action path=/RegisterSubmit forward=/store/address.jsp /action But if I use a html-el:form... then it blows up on a null form. If I use a from... then it doesn't go to the mapped page. Is there any way to do this other than creating a do nothing action and form? (Seems to me it should be possible.) thanks - dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: action-mapping forward - how do I use it?
David, what happens when you use a form ... ? If the URL is wrong, have you tried html:rewrite... ? Alternatively, don't use a form. Use a button inside a a/a Hope that helps Adam On 08/27/2003 09:56 PM David Thielen wrote: Hi; I have a case where, when the user clicks on a button, I want the action to be to go to a new page. No ActionServlet or ActionForm because the only thing in the form is the button. But I would like to use the action-mapping to determine where to go. I tried to do this with: action path=/RegisterSubmit forward=/store/address.jsp /action But if I use a html-el:form... then it blows up on a null form. If I use a from... then it doesn't go to the mapped page. Is there any way to do this other than creating a do nothing action and form? (Seems to me it should be possible.) thanks - dave -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: action-mapping forward - how do I use it?
That will work. But I am wondering why the action/forward doesn't work. Fromt he docs it seems like it should. thanks - dave - Original Message - From: Adam Hardy [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, August 28, 2003 2:51 AM Subject: Re: action-mapping forward - how do I use it? David, what happens when you use a form ... ? If the URL is wrong, have you tried html:rewrite... ? Alternatively, don't use a form. Use a button inside a a/a Hope that helps Adam On 08/27/2003 09:56 PM David Thielen wrote: Hi; I have a case where, when the user clicks on a button, I want the action to be to go to a new page. No ActionServlet or ActionForm because the only thing in the form is the button. But I would like to use the action-mapping to determine where to go. I tried to do this with: action path=/RegisterSubmit forward=/store/address.jsp /action But if I use a html-el:form... then it blows up on a null form. If I use a from... then it doesn't go to the mapped page. Is there any way to do this other than creating a do nothing action and form? (Seems to me it should be possible.) thanks - dave -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
action-mapping forward - how do I use it?
Hi; I have a case where, when the user clicks on a button, I want the action to be to go to a new page. No ActionServlet or ActionForm because the only thing in the form is the button. But I would like to use the action-mapping to determine where to go. I tried to do this with: action path=/RegisterSubmit forward=/store/address.jsp /action But if I use a html-el:form... then it blows up on a null form. If I use a from... then it doesn't go to the mapped page. Is there any way to do this other than creating a do nothing action and form? (Seems to me it should be possible.) thanks - dave
Exception if no form in my action mapping - why?
Hi; When I set an action mapping as this (no form): action path=/Logout type=net.windward.store.LogoutAction forward name=next redirect=true path=/var/login.jsp/ /action It threw an exception. When I added a from like this: action path=/Logout type=net.windward.store.LogoutAction name=loginForm forward name=next redirect=true path=/var/login.jsp/ /action It worked. Any ideas? In my .jsp I have: html-el:form action=/Logout styleClass=whiteBkgnd html-el:submit property=submit value=Logout/ /html-el:form thanks - dave
RE: Exception if no form in my action mapping - why?
If an action is used in a form tag, it is expected that it has a form attribute defined for it. Otherwise, Struts does not know where to put the data posted from the form. In your case, you don't have much of a form or need to store posted data. You could redefine as a link rather than a form. Steve -Original Message- From: David Thielen [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 8:47 AM To: Struts-Users Subject: Exception if no form in my action mapping - why? Hi; When I set an action mapping as this (no form): action path=/Logout type=net.windward.store.LogoutAction forward name=next redirect=true path=/var/login.jsp/ /action It threw an exception. When I added a from like this: action path=/Logout type=net.windward.store.LogoutAction name=loginForm forward name=next redirect=true path=/var/login.jsp/ /action It worked. Any ideas? In my .jsp I have: html-el:form action=/Logout styleClass=whiteBkgnd html-el:submit property=submit value=Logout/ /html-el:form thanks - dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Action mapping 'inputForward'
Hi all, Is it recommended to use the 'inputForward'=true in the controller configuration? Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action mapping 'inputForward'
On Fri, 15 Aug 2003, Erez Efrati wrote: Date: Fri, 15 Aug 2003 18:49:25 +0200 From: Erez Efrati [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: Action mapping 'inputForward' Hi all, Is it recommended to use the 'inputForward'=true in the controller configuration? I do that all the time now. Among other things, it makes life much easier when you want to use multiple modules, or play with settings like forwardPattern and pagePatetrn. Finally, it's more consistent with the use of forwards everywhere else in Struts, and I sort of wish I'd made input take the name of a forward from the very beginning :-). Thanks, Erez Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action mapping 'inputForward'
- Original Message - From: Craig R. McClanahan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, August 15, 2003 11:05 AM Subject: Re: Action mapping 'inputForward' On Fri, 15 Aug 2003, Erez Efrati wrote: Date: Fri, 15 Aug 2003 18:49:25 +0200 From: Erez Efrati [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: Action mapping 'inputForward' Hi all, Is it recommended to use the 'inputForward'=true in the controller configuration? I do that all the time now. Among other things, it makes life much easier when you want to use multiple modules, or play with settings like forwardPattern and pagePatetrn. Finally, it's more consistent with the use of forwards everywhere else in Struts, and I sort of wish I'd made input take the name of a forward from the very beginning :-). Your statements let me re-think the semantics of the input as an attribute in an action mapping. The original input means the incoming page for the current http request. But people started to use it to forward to any logically meaningful places, like *.do. So, it looks like the name input is too restrictive. When I started to study the action mapping, I realized we probably need another attribute, let us call it output for now. Why? If we follow the principle of symmetry for designs, there should be an output attribute on the action mapping to mean the outgoing page. So we have the input and output attributes for the incoming and outgoing pages respectively. With the output attribute, developers could specify the default next page to forward. The Action base class could be enhanced to honor the output attribute if it is specified. Otherwise, it returns null as before. There was a lengthy discussion in the developer list about the SuccessAction which is to honor a success token or a globally defined constant. The purpose of the class is to ease the prototype. Now, if you could enhance the Action base class with the output attribute, all problems could be cleanly solved. Should we think it about again? Or what I mean is your original naming convention was just right :-) Thanks, Erez Craig Jing Netspread Carrier http://www.netspread.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: One form multiple Action mapping
What about: html:form action=/Reg.do c:if ... html:hidden property=method value=dispatchMeth1 / /c:if c:otherwise html:hidden property=method value=dispatchMeth2 / /c:otherwise /html:form -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 11:04 AM To: 'Struts Users Mailing List' Subject: One form multiple Action mapping I have a registration form (RegForm) which based on the method/mode I want to direct it to a different action mapping in order to assign different roles or security restrictions. I have a single RegAction extending the DispatchAction class, with parameter 'method' as the dispatch parameter. I thought of maybe put a c:if .. and based on the 'method' put the correct html:form .. one. But then again maybe this will harm the javascript validation, cause the name of the form will be different. How can this be done? Registration.jsp: html:form action=/Reg.do?method=create ... /html:form Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
One form multiple Action mapping
I have a registration form (RegForm) which based on the method/mode I want to direct it to a different action mapping in order to assign different roles or security restrictions. I have a single RegAction extending the DispatchAction class, with parameter 'method' as the dispatch parameter. I thought of maybe put a c:if .. and based on the 'method' put the correct html:form .. one. But then again maybe this will harm the javascript validation, cause the name of the form will be different. How can this be done? Registration.jsp: html:form action=/Reg.do?method=create ... /html:form Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: One form multiple Action mapping
Come to think of it more, since I want the submitted form to use different action mappings, I thought of using something like Scanfold's RelayAction which dispatches to different action mappings based on the parameter (in my case 'method'). On each action mapping I could set my required roles etc. and then have them all forwarded to the RegistrationAction for processing. This way I can distinguish between them and still process them in a single point (Action). What do you think? Erez -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 4:03 PM To: 'Struts Users Mailing List' Subject: RE: One form multiple Action mapping What about: html:form action=/Reg.do c:if ... html:hidden property=method value=dispatchMeth1 / /c:if c:otherwise html:hidden property=method value=dispatchMeth2 / /c:otherwise /html:form -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 11:04 AM To: 'Struts Users Mailing List' Subject: One form multiple Action mapping I have a registration form (RegForm) which based on the method/mode I want to direct it to a different action mapping in order to assign different roles or security restrictions. I have a single RegAction extending the DispatchAction class, with parameter 'method' as the dispatch parameter. I thought of maybe put a c:if .. and based on the 'method' put the correct html:form .. one. But then again maybe this will harm the javascript validation, cause the name of the form will be different. How can this be done? Registration.jsp: html:form action=/Reg.do?method=create ... /html:form Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
extending RequestProcessor for only ONE action mapping
I've just recently began hacking out my own RequestProcessor extension and I have found that my extended versions are not needed very much. Most of the time I would like to use the default struts provided RequestProcessor and for individual action mappings be able to specify an extended RequestProcessor. Is this possible? Also, is there any reasonable documentation/tutorial type information regarding extension of the struts framework I tried googling all afternoon but didn't find much I considered useful. Thanks Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: extending RequestProcessor for only ONE action mapping
I've just recently began hacking out my own RequestProcessor extension and I have found that my extended versions are not needed very much. Most of the time I would like to use the default struts provided RequestProcessor and for individual action mappings be able to specify an extended RequestProcessor. Is this possible? There may be a simpler alternative, but if needs be you can just call super.thatMethod() (in all the methods you overide) first when the extended beheviour isn't required. Can't remember what the RP gets access to but likely it gets an Action mapping, perhaps with the use of set-property you can flag when to use this behaviour? -- Mike W - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: [newbie] Problem with Action Mapping
You have to add '.do' to the action property of your form tag, like this: html:form action=/Login.do HTH Robert -Ursprüngliche Nachricht- Von: struts user [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 24. Juli 2003 15:33 An: [EMAIL PROTECTED] Betreff: Re: [newbie] Problem with Action Mapping I tried both the ways in the login.jsp 1 html:form action=/Login AND 2. html:form action=/Login name=LoginForm type=com.xxx.yyy.LoginForm Both the ways i got same response. Any ideas about the placement of the LoginForm and LoginAction classes, as to where they have to be placed. I placed them in the WEB-INF/classes/com/xxx/yyy/action where the package for both LoginForm and LoginAction classes is com.xxx.yyy.action Regards, Meka Toka From: Susan Bradeen [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: [newbie] Problem with Action Mapping Date: Thu, 24 Jul 2003 08:55:12 -0400 On 07/24/2003 08:22:44 AM struts user wrote: Hi, I am new to Struts, i am facing the following a problem with the action mappings. Here are my code snippets related to mapping the action In web.xml servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping In login.jsp - html:form action=/Login name=LoginForm type=com.xxx.yyy.LoginForm Change the JSP above to be html:form action=/Login . Not sure if that will help, but the form name and type attributes are automatically picked up from your struts-config file. Susan In struts-config.xml - FORM-BEANS form-beans form-bean name=LoginForm type=com.xxx.yyy.LoginForm/ /form-beans GLOBAL FORWARDING -- global-forwards forward name=Login path=/login.jsp/ /global-forwards ACTION MAPINGS action-mappings action path=/Login type=com.xxx.yyy.LoginAction scope=request input=/login.jsp name=LoginForm forward name=Success path=/welcome.jsp/ forward name=Failure path=/login.jsp/ /action With the above code, when the login.jsp is submitted the values have to be filled in LoginForm which is an ActionForm for the ActionClass LoginAction . The associated action path is supposed to be /Login but when the jsp is submitted i get an error page saying The requested resource (/MyApp/Login.do) is not available. Can somebody point me where am i wrong ? I am using Tomcat 4.1.24, Struts 1.1 TIA Meka Toka PS: And Yes, I have defined the ActionServlet in the web.xml _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[newbie] Problem with Action Mapping
Hi, I am new to Struts, i am facing the following a problem with the action mappings. Here are my code snippets related to mapping the action In web.xml servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping In login.jsp - html:form action=/Login name=LoginForm type=com.xxx.yyy.LoginForm In struts-config.xml - FORM-BEANS form-beans form-bean name=LoginForm type=com.xxx.yyy.LoginForm/ /form-beans GLOBAL FORWARDING -- global-forwards forward name=Login path=/login.jsp/ /global-forwards ACTION MAPINGS action-mappings action path=/Login type=com.xxx.yyy.LoginAction scope=request input=/login.jsp name=LoginForm forward name=Success path=/welcome.jsp/ forward name=Failure path=/login.jsp/ /action With the above code, when the login.jsp is submitted the values have to be filled in LoginForm which is an ActionForm for the ActionClass LoginAction . The associated action path is supposed to be /Login but when the jsp is submitted i get an error page saying The requested resource (/MyApp/Login.do) is not available. Can somebody point me where am i wrong ? I am using Tomcat 4.1.24, Struts 1.1 TIA Meka Toka PS: And Yes, I have defined the ActionServlet in the web.xml _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newbie] Problem with Action Mapping
On 07/24/2003 08:22:44 AM struts user wrote: Hi, I am new to Struts, i am facing the following a problem with the action mappings. Here are my code snippets related to mapping the action In web.xml servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping In login.jsp - html:form action=/Login name=LoginForm type=com.xxx.yyy.LoginForm Change the JSP above to be html:form action=/Login . Not sure if that will help, but the form name and type attributes are automatically picked up from your struts-config file. Susan In struts-config.xml - FORM-BEANS form-beans form-bean name=LoginForm type=com.xxx.yyy.LoginForm/ /form-beans GLOBAL FORWARDING -- global-forwards forward name=Login path=/login.jsp/ /global-forwards ACTION MAPINGS action-mappings action path=/Login type=com.xxx.yyy.LoginAction scope=request input=/login.jsp name=LoginForm forward name=Success path=/welcome.jsp/ forward name=Failure path=/login.jsp/ /action With the above code, when the login.jsp is submitted the values have to be filled in LoginForm which is an ActionForm for the ActionClass LoginAction . The associated action path is supposed to be /Login but when the jsp is submitted i get an error page saying The requested resource (/MyApp/Login.do) is not available. Can somebody point me where am i wrong ? I am using Tomcat 4.1.24, Struts 1.1 TIA Meka Toka PS: And Yes, I have defined the ActionServlet in the web.xml _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newbie] Problem with Action Mapping
I tried both the ways in the login.jsp 1 html:form action=/Login AND 2. html:form action=/Login name=LoginForm type=com.xxx.yyy.LoginForm Both the ways i got same response. Any ideas about the placement of the LoginForm and LoginAction classes, as to where they have to be placed. I placed them in the WEB-INF/classes/com/xxx/yyy/action where the package for both LoginForm and LoginAction classes is com.xxx.yyy.action Regards, Meka Toka From: Susan Bradeen [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: [newbie] Problem with Action Mapping Date: Thu, 24 Jul 2003 08:55:12 -0400 On 07/24/2003 08:22:44 AM struts user wrote: Hi, I am new to Struts, i am facing the following a problem with the action mappings. Here are my code snippets related to mapping the action In web.xml servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping In login.jsp - html:form action=/Login name=LoginForm type=com.xxx.yyy.LoginForm Change the JSP above to be html:form action=/Login . Not sure if that will help, but the form name and type attributes are automatically picked up from your struts-config file. Susan In struts-config.xml - FORM-BEANS form-beans form-bean name=LoginForm type=com.xxx.yyy.LoginForm/ /form-beans GLOBAL FORWARDING -- global-forwards forward name=Login path=/login.jsp/ /global-forwards ACTION MAPINGS action-mappings action path=/Login type=com.xxx.yyy.LoginAction scope=request input=/login.jsp name=LoginForm forward name=Success path=/welcome.jsp/ forward name=Failure path=/login.jsp/ /action With the above code, when the login.jsp is submitted the values have to be filled in LoginForm which is an ActionForm for the ActionClass LoginAction . The associated action path is supposed to be /Login but when the jsp is submitted i get an error page saying The requested resource (/MyApp/Login.do) is not available. Can somebody point me where am i wrong ? I am using Tomcat 4.1.24, Struts 1.1 TIA Meka Toka PS: And Yes, I have defined the ActionServlet in the web.xml _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newbie] Problem with Action Mapping
Try to add action path=/LoginForm forward=/login.jsp/ in action-mappings - Original Message - From: struts user [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 24, 2003 9:32 PM Subject: Re: [newbie] Problem with Action Mapping I tried both the ways in the login.jsp 1 html:form action=/Login AND 2. html:form action=/Login name=LoginForm type=com.xxx.yyy.LoginForm Both the ways i got same response. Any ideas about the placement of the LoginForm and LoginAction classes, as to where they have to be placed. I placed them in the WEB-INF/classes/com/xxx/yyy/action where the package for both LoginForm and LoginAction classes is com.xxx.yyy.action Regards, Meka Toka From: Susan Bradeen [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: [newbie] Problem with Action Mapping Date: Thu, 24 Jul 2003 08:55:12 -0400 On 07/24/2003 08:22:44 AM struts user wrote: Hi, I am new to Struts, i am facing the following a problem with the action mappings. Here are my code snippets related to mapping the action In web.xml servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping In login.jsp - html:form action=/Login name=LoginForm type=com.xxx.yyy.LoginForm Change the JSP above to be html:form action=/Login . Not sure if that will help, but the form name and type attributes are automatically picked up from your struts-config file. Susan In struts-config.xml - FORM-BEANS form-beans form-bean name=LoginForm type=com.xxx.yyy.LoginForm/ /form-beans GLOBAL FORWARDING -- global-forwards forward name=Login path=/login.jsp/ /global-forwards ACTION MAPINGS action-mappings action path=/Login type=com.xxx.yyy.LoginAction scope=request input=/login.jsp name=LoginForm forward name=Success path=/welcome.jsp/ forward name=Failure path=/login.jsp/ /action Try to add action path=/LoginForm forward=/login.jsp/ With the above code, when the login.jsp is submitted the values have to be filled in LoginForm which is an ActionForm for the ActionClass LoginAction . The associated action path is supposed to be /Login but when the jsp is submitted i get an error page saying The requested resource (/MyApp/Login.do) is not available. Can somebody point me where am i wrong ? I am using Tomcat 4.1.24, Struts 1.1 TIA Meka Toka PS: And Yes, I have defined the ActionServlet in the web.xml _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
action mapping 'input' question
I guess it's simple, but why can't I put an action /MyAction.do in the 'input' field in a action-mapping in the struts-config.xml? Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: action mapping 'input' question
You can but have to account for the state the form associated with /MyAction.do. Before I try to suggest a solution can you please tell us specifically what problem you are experiencing? -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 9:46 AM To: 'Struts Users Mailing List' Subject: action mapping 'input' question I guess it's simple, but why can't I put an action /MyAction.do in the 'input' field in a action-mapping in the struts-config.xml? Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: action mapping 'input' question
I am using struts/tiles/validator in my application. Using the following configuration works fine, still I see that on the first invocation the form gets validated and I get validation errors. My ForgotPasswordAction action is used both for the INIT and the SUBMIT operations. The only solution I read about is putting 'validate'=false and control the invocation of the super.validate() in my code. Is this true? action name=ForgotPasswordForm type=web.ForgotPasswordAction validate=true input=.forgotPassword scope=request path=/ForgotPassword forward name=show path=.forgotPassword redirect=false / /action If I use the following: action name=ForgotPasswordForm type=web.ForgotPasswordAction validate=true input=/ForgotPassword.do scope=request path=/ForgotPassword forward name=show path=.forgotPassword redirect=false / /action Then I get the following error: (now it's endless... really so sorry :) javax.servlet.ServletException: Servlet execution threw an exception at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:19 9) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja va:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 5) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:59 4) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:56 5) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:619) at java.lang.Thread.run(Thread.java:536) root cause java.lang.StackOverflowError at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(Application HttpRequest.java:247) at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(Application HttpRequest.java:250) at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(Application HttpRequest.java:250) at
RE: action mapping 'input' question
Unless validation suceeds, this looks like an infinite loop to me: input=/ForgotPassword.do path=/ForgotPassword m --- Erez Efrati [EMAIL PROTECTED] wrote: I am using struts/tiles/validator in my application. Using the following configuration works fine, still I see that on the first invocation the form gets validated and I get validation errors. My ForgotPasswordAction action is used both for the INIT and the SUBMIT operations. The only solution I read about is putting 'validate'=false and control the invocation of the super.validate() in my code. Is this true? action name=ForgotPasswordForm type=web.ForgotPasswordAction validate=true input=.forgotPassword scope=request path=/ForgotPassword forward name=show path=.forgotPassword redirect=false / /action If I use the following: action name=ForgotPasswordForm type=web.ForgotPasswordAction validate=true input=/ForgotPassword.do scope=request path=/ForgotPassword forward name=show path=.forgotPassword redirect=false / /action Then I get the following error: (now it's endless... really so sorry :) javax.servlet.ServletException: Servlet execution threw an exception at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:19 9) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja va:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 5) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:59 4) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:56 5) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:619) at java.lang.Thread.run(Thread.java:536) root cause java.lang.StackOverflowError at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(Application HttpRequest.java:247) at
action-mapping in include tag
Hello Everyone, How can I include an action-mapping in a jsp include directive ? I want to achieve something like this: jsp:include page=Test.do / Is there any solution using TILES or something else ? Thanks, BS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tiles - input attribute in action mapping
Hi I'm using different tiles to create my page. On my login tile, name and password are required fields, so the validator creates an error if one is not provided. Normally, you are redirected to the 'input' attribute of the action mapping in the struts-config. When I put the login-tile in the input attribute, I get an error. I tried to put a tiles-definition in the input attribute, and that didn't work either. What do I have to put as the input attribute ? Thanks Koen Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail! http://login.mail.lycos.com/r/referral?aid=27005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Posted Again: Build Navigation based on action mapping
Sorry for reposting but wanted to get some feedback on this as I am sure everyone here had to deal with this at some point. I am trying to find a way to have navigation built based on the struts-config.xml's action mappings. Since all my use cases are enabled through action listed under action mapping, this seemed like a good place to start. Anyone done this before or has other robust ideas to build a navigation that can update as my site's features change? Thanks, Haytham Below is my first posting: I am trying to build a navigation component that basically runs of the struts config file's action mappings. Anyone ever done this before or has ideas on ways to build navigation from the struts config xml file? I would like it to dynamically update with changes to my site's navaigation/flow and use the role information included with the mappings. Thanks. Haytham - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Build Navigation based on action mapping
I'm guessing that what you really want is to be able to do either a) some reverse engineering/documentation or b) a site map type function because navigation in a Struts app is absolutely based on action mapping and tiles config. That said (and without a clearer question), I will give some very bland advice... Both struts-config and tiles-defs end in .xml and reference a DTD. So it is quite easy to parse them and store the content in memory. After all, that's what Struts does! What you do from there is up to you and your intended goal. David Hibbs Staff Programmer / Analyst Distributed Applications Development and Support American National Insurance Company -Original Message- From: Haytham Samad [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 03, 2003 8:00 AM To: Struts Users Mailing List Subject: Posted Again: Build Navigation based on action mapping Sorry for reposting but wanted to get some feedback on this as I am sure everyone here had to deal with this at some point. I am trying to find a way to have navigation built based on the struts-config.xml's action mappings. Since all my use cases are enabled through action listed under action mapping, this seemed like a good place to start. Anyone done this before or has other robust ideas to build a navigation that can update as my site's features change? Thanks, Haytham Below is my first posting: I am trying to build a navigation component that basically runs of the struts config file's action mappings. Anyone ever done this before or has ideas on ways to build navigation from the struts config xml file? I would like it to dynamically update with changes to my site's navaigation/flow and use the role information included with the mappings. Thanks. Haytham - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts console action mapping attribute question.
What is the Configuration class attribute of an action mapping in the struts console? I see it adds a className= but I have no idea what this is used for in Struts 1.1rc1 Thank You Mick Knutson Sr. Designer - Project Trust aUBS AG, Financial - Zürich Office: +41 (0)1/234.42.75 Internal: 48194 Mobile: 079.726.14.26 Visit our website at http://www.ubswarburg.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts console action mapping attribute question.
Check the struts-config.xml DTD. David From: [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Struts console action mapping attribute question. Date: Thu, 20 Mar 2003 16:43:48 +0100 What is the Configuration class attribute of an action mapping in the struts console? I see it adds a className= but I have no idea what this is used for in Struts 1.1rc1 Thank You Mick Knutson Sr. Designer - Project Trust aUBS AG, Financial - Zürich Office: +41 (0)1/234.42.75 Internal: 48194 Mobile: 079.726.14.26 Visit our website at http://www.ubswarburg.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
action-mapping redirect
Greetings, I need to forward/redirect to an htm page on success. In my action mapping I have mentioned forward name=success path=/pages/Dummy.htm redirect=true/ my htm pages are in c:\testweb\pages and jsp are under ..\tomcat\webapps\myexample since the context is getting added the htm page does not get displayed. Is there any work around to redirect to a htm page avoiding the context being added? regards, Dinesh Samson J - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Action Mapping path vs parameter
There appears to be a one to one relationship with regards to the path and parameter values in action mappings. Is there any particular reason why one would use both of these instead of just the path to determine the correct course of action? Regards, Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
action mapping
I remembered some one on the list had said that ActionMapping is deprecated in 1.1b3. If ActionMapping is deprecated, why all those Action.execute still accept ActionMapping as argument? Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing
Re: action mapping
Only for compatibility reasons between 1.0 and 1.1 javadoc said : NOTE - This class would have been deprecated and replaced by org.apache.struts.config.ActionConfig except for the fact that it is part of the public API that existing applications are using. http://jakarta.apache.org/struts/api/org/apache/struts/action/ActionMapping.html For more information read section 'What's different?' in http://jakarta.apache.org/struts/userGuide/release-notes.html -emmanuel --- [EMAIL PROTECTED] a écrit : I remembered some one on the list had said that ActionMapping is deprecated in 1.1b3. If ActionMapping is deprecated, why all those Action.execute still accept ActionMapping as argument? Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
follow up on action mapping
Last week I asked if action mapping's input accepts action. The answer is Yes after I did a test. action path=/myAction1 type=myActionClass1 input=/myAction2.do forward../ /action input can be a page or an action. Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing
How to access the current action mapping from the jsp
i'm trying to build a dynamic navigation widget in a header.jsp that will be included in all my display jsps. i have elected not to use tiles. in order to correctly render the navigation, i need to know what the current action forward is that is being executed. how can i access that from the jsp page without introducing a new parameter to keep it in the session scope? thanks. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
struts-config action-mapping how to set custom attribute
Hi there I was wondering if there is a way to set a custom attrbiute to an action mapping, and then retieve it using the ActionMapping class. I notice that the ActionMapping class has a getAttribute(String s) method, but I am not sure if there is a way to set that attribute in the struts-config file Can anyone help me here? Regards Steve Vanspall -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How to get the action mapping
Hi All, A newbie with a basic question (I hope...). How do I get the action mapping from the current request? thanks Jordan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
action-mapping
I am a newbie but I am a little confused about the following. In the struts api it states the following about the forward property of the action mapping class Exactly one of the forward, include, or type properties must be specified. But, in the examples I downloaded with the struts package they have multiple forward entries along with a type entry. Also, the forward entry is used by whatever action class services this request. return (mapping.findForward(success)); Somebody shed some light on this for me please. thanks We come from the land of the ice and snow With the midnight sun, where the hot springs glow The hammer of the gods, will drive our ships to new lands Fight the horde, Sing and cry Valhalla I am coming
Re: action-mapping
It's talking about the properties of the action element. You can define multiple forwards for an action to use. David From: LUCERO,DENNIS (HP-Boise,ex1) [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: ' ([EMAIL PROTECTED])' [EMAIL PROTECTED] Subject: action-mapping Date: Wed, 4 Dec 2002 16:09:05 -0500 I am a newbie but I am a little confused about the following. In the struts api it states the following about the forward property of the action mapping class Exactly one of the forward, include, or type properties must be specified. But, in the examples I downloaded with the struts package they have multiple forward entries along with a type entry. Also, the forward entry is used by whatever action class services this request. return (mapping.findForward(success)); Somebody shed some light on this for me please. thanks We come from the land of the ice and snow With the midnight sun, where the hot springs glow The hammer of the gods, will drive our ships to new lands Fight the horde, Sing and cry Valhalla I am coming _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: action-mapping
You a 3 type of action-mapping : A simple forward action path=/toto forward=/toto.jsp/ A simple include action path=/toto include=/toto.jsp/ Or a typed action : action path=/toto type=com.toto.TotoAction forward name=success path=/ok.jsp/ forward name=failure path=/error.jsp/ /action With the forward/include action, you don't need to create an action class, they are using only to forward/include one path. With an typed action, you can define multiple forwards depending of the state of your operation, use mapping.findForward( NAME ); Is it clear ? -emmanuel LUCERO,DENNIS (HP-Boise,ex1) lt;[EMAIL PROTECTED]gt; a écrit : I am a newbie but I am a little confused about the following. In the struts api it states the following about the forward property of the action mapping class Exactly one of the forward, include, or type properties must be specified. But, in the examples I downloaded with the struts package they have multiple forward entries along with a type entry. Also, the forward entry is used by whatever action class services this request. return (mapping.findForward(success)); Somebody shed some light on this for me please. thanks We come from the land of the ice and snow With the midnight sun, where the hot springs glow The hammer of the gods, will drive our ships to new lands Fight the horde, Sing and cry Valhalla I am coming - Soyez solidaire soutenez laction du Téléthon avec Yahoo! France. Cliquez ici pour faire un don !
RE: action mapping input
Okay, I misunderstood what John was saying and this is what I have: 1) forward failure is NOT the same as input which is required if validate=true 2) input CAN forward to a tiles definition. I looked at the original post and realized that it was pretty ambiguous. what i wanted to do (and it was successful) was: action path=/siteSelect type=SiteSelectAction name=siteSelectForm validate=true scope=request input=site.select.page forward name=success path=site.select.global/ /action where site.select.page was a tiles definition. Thanks, -Tim -Original Message- From: Chen, Gin [mailto:Gin_Chen;tvratings.com] Sent: Friday, October 18, 2002 3:19 PM To: 'Struts Users Mailing List' Subject: RE: action mapping input Okay, just to get this straight. So I define a failure forward and it will behave the same as validation error following the input tag? No additional coding required? Also, the reason that I wanted to use the input tag instead of another forward is that I want to use the 1.1b2 method getInputForward(). It would almost make sense that with the inclusion of this new method, the intent was for it to behave as if it were looking up a forward or global. No? -Tim -Original Message- From: John Nicholas [mailto:jakarta;mobosplash.com] Sent: Friday, October 18, 2002 2:45 PM To: Struts Users Mailing List Subject: Re: action mapping input Chen, Gin wrote: Hi all, I'm still new to struts and I cant find this in the documentation but, lets say that you have one of the struts-config from the docs. global-forwards type=org.apache.struts.action.ActionForward/ forward name=logon path=/logon.jsp redirect=false / /global-forwards action-mappings action path=/logon type=org.apache.struts.example.LogonAction name=logonForm scope=request input=/logon.jsp unknown=false validate=true / /action-mappings Rather than have input=/logon.jsp as in the snip can you have input=logon and have it use the path from the global-forwards? It just seems like it would make more sense since that means that you only have to change one location in case the location of the file ever has to change. The input attribute is used when validation of the form bean fails. if the validation in the form bean (or the validator) fails the action is never run so it couldn't use the forward. The controller is returning you to the input page. If a validation in the action fails (like a business logic failure)then you can use a failure forward. John Nicholas -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: security roles per action mapping
Eddie Vicc, Thanks for your help on this. It got me started in the right direction, and I found a solution that I thought I'd share in case it's useful to someone else. In the end, I created a custom subclass of RequestProcess that overrides the processRoles() and always returns true. It's less than 10 lines of code in the end. This allows requests to reach my Action base class, which reads the action roles attributes and applies its own security logic. Because the app was throwing me to the Tomcat authentication error pages, I thought that Tomcat container-managed security (CMS) was intercepting the messages. This was false, and started me down the blind alley of fiddling with constraints in web.xml. But when I chased all the references to ActionMapping.getRoles(), I found that Struts itself was invoking tomcat's CMS by calling HttpServletRequest.isUserInRole() in the RequestProcessor class. Subclassing RequestProcessor solves this problem. I expect it would also work to filter requests and override isUserInRole(). This is nice because it doesn't involve customizing struts itself, but worries me because it prevents me from actually using CMS if I want to later on. Also, the filter class, the custom request subclass, and the web.xml configs leave more room for error. Thanks for the help! Alexis Like following a trail of --- Eddie Bush [EMAIL PROTECTED] wrote: Alexis Gallagher wrote: Hello, I've gotten a lot of help just lurking on this list, so I'm hoping my first question isn't too off base. I am trying to use the action roles parameter to define fine-grained security constraints. However, these constraints will apply to security roles which are defined programmatically within my webapp and which are net registered with the server's security realm. So I'm wondering, is there a way to stop the server from checking the roles parameter for its own purposes, so that I can hijack it for my own? If I seem not just confused but totally off-base, I'll stick the gory details of why I'm trying to do this in a P.S.. You could write a filter and provide wrappers for the request that would let you override the important functions. Thanks, Alexis Gallagher p.s. Why would I want to do disable the server's check of security roles? Well, in my system every user can belong to multiple projects, but he can only browse one project at a time. A user has both a global security role (admin vs. non-admin) but also a per-project security role (manager vs. member, etc.). My understanding is that container-managed security is not intended to support a situation where a user's role might changing depending on their position session state (that is, what project they're browsing). Also, container-managed security doesn't have a vendor-neutral realm implementation. Nevertheless, it would be very convenient to declaritively configure all these security constraints, and I can just put the security logic my action base class. Well, I think the thing to do would be to maybe come up with some additional roles for each project. No, wait, you'd have to be modifying your server config for every project. Nevermind that ... It smells like you really do need a custom solution. I think probably writing a filter to wrap the request so you can override isUserInRole would probably be the way to go. You could then implement that method (and any others you needed to) so that it would return the appropriate result - after having consulted your database. Ideally, what would happen is you would load all roles associated with the user in something (Map perhaps) and then just consult that (map.containsKey(roleName)). That way you're offsetting hitting the database for each request. Of course, if roles were added after a person logged in, they wouldn't have them loaded. The user would have to relog to effect the change. See version 2.3 of the servlet specification and the J2EE tutorial for information about writing a filter that would do what you need to do. You're looking at using a Filter and ... what is it called ... HttpServletRequestWrapper? That's close, I believe. I feel like maybe there's a better solution to this - but it doesn't occur to me what it might be. Hopefully someone else has further insight. -- Eddie Bush -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
action mapping input
Hi all, I'm still new to struts and I cant find this in the documentation but, lets say that you have one of the struts-config from the docs. global-forwards type=org.apache.struts.action.ActionForward/ forward name=logon path=/logon.jsp redirect=false / /global-forwards action-mappings action path=/logon type=org.apache.struts.example.LogonAction name=logonForm scope=request input=/logon.jsp unknown=false validate=true / /action-mappings Rather than have input=/logon.jsp as in the snip can you have input=logon and have it use the path from the global-forwards? It just seems like it would make more sense since that means that you only have to change one location in case the location of the file ever has to change. Thanks, -Tim -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Wednesday, October 09, 2002 1:25 PM To: Struts Users Mailing List Subject: Re: Avoid Heavy Use of Logic Tags ??? ... and now that we have the JSTL you can have your tags optimized into actual code. It's my understanding, for example, that a forEach tag would be translated into an actual while (or was it for ... anyway, you get the point). So, you're bypassing the tag-usage overhead some. Hopefully Martin will see this and elaborate (and correct me if I'm wrong). I believe that's fairly close though ... Of course - not all of us are on containers that even support the JSTL ... but some of us are :-) Robert wrote: I think that statement Using custom tags for logic provides little benefit... is bit vague. I would say that custom tags the do PRESENTATION logic are of benefit, e.g. iterators, formatting, html controls, etc. all fit into that category for me. You are right, you have to do it somehow, where otherwise you end up with just static HTML right? I'm not sure why he would say that XML syntax is more difficult to maintain than other types. That is probably more of an 'eye of the beholder' issue. If you have web developers that are unfamiliar with Java, then the XML syntax is probably easier than a bunch of scriptlets, no? Personally I think it is a lot easier to read than other dynamic page systems (ASP, PHP, etc.), but that is just me. - Robert -- Eddie Bush -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: action mapping input
Chen, Gin wrote: Hi all, I'm still new to struts and I cant find this in the documentation but, lets say that you have one of the struts-config from the docs. global-forwards type=org.apache.struts.action.ActionForward/ forward name=logon path=/logon.jsp redirect=false / /global-forwards action-mappings action path=/logon type=org.apache.struts.example.LogonAction name=logonForm scope=request input=/logon.jsp unknown=false validate=true / /action-mappings Rather than have input=/logon.jsp as in the snip can you have input=logon and have it use the path from the global-forwards? It just seems like it would make more sense since that means that you only have to change one location in case the location of the file ever has to change. The input attribute is used when validation of the form bean fails. if the validation in the form bean (or the validator) fails the action is never run so it couldn't use the forward. The controller is returning you to the input page. If a validation in the action fails (like a business logic failure)then you can use a failure forward. John Nicholas -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: action mapping input
Okay, just to get this straight. So I define a failure forward and it will behave the same as validation error following the input tag? No additional coding required? Also, the reason that I wanted to use the input tag instead of another forward is that I want to use the 1.1b2 method getInputForward(). It would almost make sense that with the inclusion of this new method, the intent was for it to behave as if it were looking up a forward or global. No? -Tim -Original Message- From: John Nicholas [mailto:jakarta;mobosplash.com] Sent: Friday, October 18, 2002 2:45 PM To: Struts Users Mailing List Subject: Re: action mapping input Chen, Gin wrote: Hi all, I'm still new to struts and I cant find this in the documentation but, lets say that you have one of the struts-config from the docs. global-forwards type=org.apache.struts.action.ActionForward/ forward name=logon path=/logon.jsp redirect=false / /global-forwards action-mappings action path=/logon type=org.apache.struts.example.LogonAction name=logonForm scope=request input=/logon.jsp unknown=false validate=true / /action-mappings Rather than have input=/logon.jsp as in the snip can you have input=logon and have it use the path from the global-forwards? It just seems like it would make more sense since that means that you only have to change one location in case the location of the file ever has to change. The input attribute is used when validation of the form bean fails. if the validation in the form bean (or the validator) fails the action is never run so it couldn't use the forward. The controller is returning you to the input page. If a validation in the action fails (like a business logic failure)then you can use a failure forward. John Nicholas -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: action mapping input
You can also leverage the input attribute in an action by returning the following from perform/execute: new ActionForward(mapping.getInput()) Quoting John Nicholas [EMAIL PROTECTED]: Chen, Gin wrote: Hi all, I'm still new to struts and I cant find this in the documentation but, lets say that you have one of the struts-config from the docs. global-forwards type=org.apache.struts.action.ActionForward/ forward name=logon path=/logon.jsp redirect=false / /global-forwards action-mappings action path=/logon type=org.apache.struts.example.LogonAction name=logonForm scope=request input=/logon.jsp unknown=false validate=true / /action-mappings Rather than have input=/logon.jsp as in the snip can you have input=logon and have it use the path from the global-forwards? It just seems like it would make more sense since that means that you only have to change one location in case the location of the file ever has to change. The input attribute is used when validation of the form bean fails. if the validation in the form bean (or the validator) fails the action is never run so it couldn't use the forward. The controller is returning you to the input page. If a validation in the action fails (like a business logic failure)then you can use a failure forward. John Nicholas -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- Kris Schneider mailto:kris;dotech.com D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: action mapping input
I haven't played much with 1.1, but here's a snippet from the 1.1 DTD about the controller element's inputForward attribute: inputForward Set to true if you want the input attribute of action elements to be the name of a local or global ActionForward, which will then be used to calculate the ultimate URL. Set to false (the default) to treat the input parameter of action elements as a module-relative path to the resource to be used as the input form. Since Struts 1.1. [false] So, it sounds like you can configure it to have the behavior you want. The attribute affects the way ActionMapping.getInputForward behaves. It's a small piece of code, so here it is: public ActionForward getInputForward() { if (getApplicationConfig().getControllerConfig().getInputForward()) { return (findForward(getInput())); } else { return (new ActionForward(getInput())); } } Quoting Chen, Gin [EMAIL PROTECTED]: Okay, just to get this straight. So I define a failure forward and it will behave the same as validation error following the input tag? No additional coding required? Also, the reason that I wanted to use the input tag instead of another forward is that I want to use the 1.1b2 method getInputForward(). It would almost make sense that with the inclusion of this new method, the intent was for it to behave as if it were looking up a forward or global. No? -Tim -Original Message- From: John Nicholas [mailto:jakarta;mobosplash.com] Sent: Friday, October 18, 2002 2:45 PM To: Struts Users Mailing List Subject: Re: action mapping input Chen, Gin wrote: Hi all, I'm still new to struts and I cant find this in the documentation but, lets say that you have one of the struts-config from the docs. global-forwards type=org.apache.struts.action.ActionForward/ forward name=logon path=/logon.jsp redirect=false / /global-forwards action-mappings action path=/logon type=org.apache.struts.example.LogonAction name=logonForm scope=request input=/logon.jsp unknown=false validate=true / /action-mappings Rather than have input=/logon.jsp as in the snip can you have input=logon and have it use the path from the global-forwards? It just seems like it would make more sense since that means that you only have to change one location in case the location of the file ever has to change. The input attribute is used when validation of the form bean fails. if the validation in the form bean (or the validator) fails the action is never run so it couldn't use the forward. The controller is returning you to the input page. If a validation in the action fails (like a business logic failure)then you can use a failure forward. John Nicholas -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- Kris Schneider mailto:kris;dotech.com D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
security roles per action mapping
Hello, I've gotten a lot of help just lurking on this list, so I'm hoping my first question isn't too off base. I am trying to use the action roles parameter to define fine-grained security constraints. However, these constraints will apply to security roles which are defined programmatically within my webapp and which are net registered with the server's security realm. So I'm wondering, is there a way to stop the server from checking the roles parameter for its own purposes, so that I can hijack it for my own? If I seem not just confused but totally off-base, I'll stick the gory details of why I'm trying to do this in a P.S.. Thanks, Alexis Gallagher p.s. Why would I want to do disable the server's check of security roles? Well, in my system every user can belong to multiple projects, but he can only browse one project at a time. A user has both a global security role (admin vs. non-admin) but also a per-project security role (manager vs. member, etc.). My understanding is that container-managed security is not intended to support a situation where a user's role might changing depending on their position session state (that is, what project they're browsing). Also, container-managed security doesn't have a vendor-neutral realm implementation. Nevertheless, it would be very convenient to declaritively configure all these security constraints, and I can just put the security logic my action base class. __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: security roles per action mapping
One aproach: make all the users is a single role for CMA. In first action, make a getUserPricipal, and store in session bean (I also have getFullName in there, so I display in header loged in user name) the Session bean, add methods for getProjectRole() that calls dao to find this. Based on sesionBean.getProejctRole(), your action/controller can do things like formBean.find(sessionBean.getProjectRole()) to only find things that are relevant. The book FastTrack to Struts, has a chapter on this, and also how to make this row based updates or row based RO .V Alexis Gallagher wrote: Hello, I've gotten a lot of help just lurking on this list, so I'm hoping my first question isn't too off base. I am trying to use the action roles parameter to define fine-grained security constraints. However, these constraints will apply to security roles which are defined programmatically within my webapp and which are net registered with the server's security realm. So I'm wondering, is there a way to stop the server from checking the roles parameter for its own purposes, so that I can hijack it for my own? If I seem not just confused but totally off-base, I'll stick the gory details of why I'm trying to do this in a P.S.. Thanks, Alexis Gallagher p.s. Why would I want to do disable the server's check of security roles? Well, in my system every user can belong to multiple projects, but he can only browse one project at a time. A user has both a global security role (admin vs. non-admin) but also a per-project security role (manager vs. member, etc.). My understanding is that container-managed security is not intended to support a situation where a user's role might changing depending on their position session state (that is, what project they're browsing). Also, container-managed security doesn't have a vendor-neutral realm implementation. Nevertheless, it would be very convenient to declaritively configure all these security constraints, and I can just put the security logic my action base class. __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: security roles per action mapping
Alexis Gallagher wrote: Hello, I've gotten a lot of help just lurking on this list, so I'm hoping my first question isn't too off base. I am trying to use the action roles parameter to define fine-grained security constraints. However, these constraints will apply to security roles which are defined programmatically within my webapp and which are net registered with the server's security realm. So I'm wondering, is there a way to stop the server from checking the roles parameter for its own purposes, so that I can hijack it for my own? If I seem not just confused but totally off-base, I'll stick the gory details of why I'm trying to do this in a P.S.. You could write a filter and provide wrappers for the request that would let you override the important functions. Thanks, Alexis Gallagher p.s. Why would I want to do disable the server's check of security roles? Well, in my system every user can belong to multiple projects, but he can only browse one project at a time. A user has both a global security role (admin vs. non-admin) but also a per-project security role (manager vs. member, etc.). My understanding is that container-managed security is not intended to support a situation where a user's role might changing depending on their position session state (that is, what project they're browsing). Also, container-managed security doesn't have a vendor-neutral realm implementation. Nevertheless, it would be very convenient to declaritively configure all these security constraints, and I can just put the security logic my action base class. Well, I think the thing to do would be to maybe come up with some additional roles for each project. No, wait, you'd have to be modifying your server config for every project. Nevermind that ... It smells like you really do need a custom solution. I think probably writing a filter to wrap the request so you can override isUserInRole would probably be the way to go. You could then implement that method (and any others you needed to) so that it would return the appropriate result - after having consulted your database. Ideally, what would happen is you would load all roles associated with the user in something (Map perhaps) and then just consult that (map.containsKey(roleName)). That way you're offsetting hitting the database for each request. Of course, if roles were added after a person logged in, they wouldn't have them loaded. The user would have to relog to effect the change. See version 2.3 of the servlet specification and the J2EE tutorial for information about writing a filter that would do what you need to do. You're looking at using a Filter and ... what is it called ... HttpServletRequestWrapper? That's close, I believe. I feel like maybe there's a better solution to this - but it doesn't occur to me what it might be. Hopefully someone else has further insight. -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: security roles per action mapping
Bah! Your web.xml - not your server.xml. I know what I'm talking about, I'm just experiencing technical difficulties in the broadcasting department! LOL Your web.xml holds all your role data and constraints, so using traditional CMA, you'd have to modify that file and restart the app every time you added a project. If that's a good solution for you (projects don't get added often) then it may be the easiest, most straight-forward way to go about it. I suspect you'll find that less than ideal though - and I believe the filter/wrapper approach would fit the ticket. -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
A big problem for me in Action Mapping
Hi, I have a action mapping as below, action path=/pages/sessioninvalid type=com.myapp.action.SessionInvalidAction scope=request forward name=success path=/pages/index.jsp redirect=false / /action Then i have jsp called include.jsp in pages folder with following line of code String user = (String)session.getAttribute(user); if (user == null) { System.out.println(there is no user so invalid session); request.getRequestDispatcher(sessioninvalid.do).forward(request, response); } Then I include this jsp in all my pages to check if the session is valid or not, I have some jsp in folder pages and some jsp in subfolder in side pages (say planning) now the code in include.jsp works very well in all the jsp in pages folder, but it does not work in jsp in subfolders, i get the following error 2002-10-02 18:06:44,078 INFO [HttpProcessor[8080][3]] action.RequestProcessor (RequestProcessor.java:217) - Processing a 'GET' for path '/pages/planning/sessioninvalid' 2002-10-02 18:06:44,078 ERROR [HttpProcessor[8080][3]] action.RequestProcessor (RequestProcessor.java:645) - Invalid path /pages/planning/sessioninvalid was requested so what is wrong if i have to make it work how can i do it.. thanx in advance = A$HI$H __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: A big problem for me in Action Mapping
Hi David, Thanx very much for the solution, it works fine now..i will do some more testing Ashish --- Karr, David [EMAIL PROTECTED] wrote: -Original Message- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 02, 2002 3:20 PM To: Struts Users Mailing List Subject: A big problem for me in Action Mapping Hi, I have a action mapping as below, action path=/pages/sessioninvalid type=com.myapp.action.SessionInvalidAction scope=request forward name=success path=/pages/index.jsp redirect=false / /action Then i have jsp called include.jsp in pages folder with following line of code String user = (String)session.getAttribute(user); if (user == null) { System.out.println(there is no user so invalid session); request.getRequestDispatcher(sessioninvalid.do).forward(request, response); } Then I include this jsp in all my pages to check if the session is valid or not, I have some jsp in folder pages and some jsp in subfolder in side pages (say planning) now the code in include.jsp works very well in all the jsp in pages folder, but it does not work in jsp in subfolders, i get the following error 2002-10-02 18:06:44,078 INFO [HttpProcessor[8080][3]] action.RequestProcessor (RequestProcessor.java:217) - Processing a 'GET' for path '/pages/planning/sessioninvalid' 2002-10-02 18:06:44,078 ERROR [HttpProcessor[8080][3]] action.RequestProcessor (RequestProcessor.java:645) - Invalid path /pages/planning/sessioninvalid was requested so what is wrong if i have to make it work how can i do it.. You defined the path for the action as /pages/sessioninvalid, but you asked for sessioninvalid.do. That will work from pages that are relative to the /pages folder, but not anywhere else. Change the forward to request /pages/sessioninvalid.do and you should be fine. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] = A$HI$H __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
action mapping question
Hi, Having a few problems getting my application working properly. Basically I've got a logon.jsp page which posts to logon.do action, which then validates and if successfull outputs search.jsp (shows in the browser as /logon.do ). then on search.jsp i have 2 forms, one to search.do and one to logoff.do here's my action mapping for logoff: action path=/logoff type=struts1.action.LogoffAction name=logoffForm input=/logon.do scope=request forward name=success path=/logon.jsp/ forward name=failure path=/logon.jsp/ /action first of all, i dont want to use a bean for the logoff action but it complains otherwise, so for now i've used a form with a attribute dummy with get/set/reset/validate methodsis there a way not to have to do this? if i dont have a form, I get an exception complaining the form bean is null. second, what should 'input' be? if i leave it as /logon.do then it works, but also if i put it as /tapssearch.jsp it works..so what should it be? and how can i set action-mapping to accept input from any page, seeing as for example i'll want to be able to log-off from any one of the pages(bar the logon one of course!) So that i dont have to write an action mapping for every page that has a logoff form cheers -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: action mapping question
1) why would you need a logoff form? 2) what version of struts are you using? You don't have to have a form bean declare for an action mapping. The reason it throw the exception Because you have the input attribute setting. With this setting the controller makes assumsion that your mapping has a from bean associate to it and make call to the validate methods. I guess the solution is not to provide from bean mapping and input mapping for your action. danny -Original Message- From: Darren McGuinness [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 8:17 AM To: [EMAIL PROTECTED] Subject: action mapping question Hi, Having a few problems getting my application working properly. Basically I've got a logon.jsp page which posts to logon.do action, which then validates and if successfull outputs search.jsp (shows in the browser as /logon.do ). then on search.jsp i have 2 forms, one to search.do and one to logoff.do here's my action mapping for logoff: action path=/logoff type=struts1.action.LogoffAction name=logoffForm input=/logon.do scope=request forward name=success path=/logon.jsp/ forward name=failure path=/logon.jsp/ /action first of all, i dont want to use a bean for the logoff action but it complains otherwise, so for now i've used a form with a attribute dummy with get/set/reset/validate methodsis there a way not to have to do this? if i dont have a form, I get an exception complaining the form bean is null. second, what should 'input' be? if i leave it as /logon.do then it works, but also if i put it as /tapssearch.jsp it works..so what should it be? and how can i set action-mapping to accept input from any page, seeing as for example i'll want to be able to log-off from any one of the pages(bar the logon one of course!) So that i dont have to write an action mapping for every page that has a logoff form cheers -- 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: action mapping question
1) I dont need a logoff form, but if i dont have one then i get errors of type: form bean null. 2) 1.0 Trieu, Danny wrote: 1) why would you need a logoff form? 2) what version of struts are you using? You don't have to have a form bean declare for an action mapping. The reason it throw the exception Because you have the input attribute setting. With this setting the controller makes assumsion that your mapping has a from bean associate to it and make call to the validate methods. I guess the solution is not to provide from bean mapping and input mapping for your action. danny -Original Message- From: Darren McGuinness [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 8:17 AM To: [EMAIL PROTECTED] Subject: action mapping question Hi, Having a few problems getting my application working properly. Basically I've got a logon.jsp page which posts to logon.do action, which then validates and if successfull outputs search.jsp (shows in the browser as /logon.do ). then on search.jsp i have 2 forms, one to search.do and one to logoff.do here's my action mapping for logoff: action path=/logoff type=struts1.action.LogoffAction name=logoffForm input=/logon.do scope=request forward name=success path=/logon.jsp/ forward name=failure path=/logon.jsp/ /action first of all, i dont want to use a bean for the logoff action but it complains otherwise, so for now i've used a form with a attribute dummy with get/set/reset/validate methodsis there a way not to have to do this? if i dont have a form, I get an exception complaining the form bean is null. second, what should 'input' be? if i leave it as /logon.do then it works, but also if i put it as /tapssearch.jsp it works..so what should it be? and how can i set action-mapping to accept input from any page, seeing as for example i'll want to be able to log-off from any one of the pages(bar the logon one of course!) So that i dont have to write an action mapping for every page that has a logoff form cheers -- 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: action mapping question
this error to be exact javax.servlet.ServletException: Cannot retrieve definition for form bean null Trieu, Danny wrote: 1) why would you need a logoff form? 2) what version of struts are you using? You don't have to have a form bean declare for an action mapping. The reason it throw the exception Because you have the input attribute setting. With this setting the controller makes assumsion that your mapping has a from bean associate to it and make call to the validate methods. I guess the solution is not to provide from bean mapping and input mapping for your action. danny -Original Message- From: Darren McGuinness [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 8:17 AM To: [EMAIL PROTECTED] Subject: action mapping question Hi, Having a few problems getting my application working properly. Basically I've got a logon.jsp page which posts to logon.do action, which then validates and if successfull outputs search.jsp (shows in the browser as /logon.do ). then on search.jsp i have 2 forms, one to search.do and one to logoff.do here's my action mapping for logoff: action path=/logoff type=struts1.action.LogoffAction name=logoffForm input=/logon.do scope=request forward name=success path=/logon.jsp/ forward name=failure path=/logon.jsp/ /action first of all, i dont want to use a bean for the logoff action but it complains otherwise, so for now i've used a form with a attribute dummy with get/set/reset/validate methodsis there a way not to have to do this? if i dont have a form, I get an exception complaining the form bean is null. second, what should 'input' be? if i leave it as /logon.do then it works, but also if i put it as /tapssearch.jsp it works..so what should it be? and how can i set action-mapping to accept input from any page, seeing as for example i'll want to be able to log-off from any one of the pages(bar the logon one of course!) So that i dont have to write an action mapping for every page that has a logoff form cheers -- 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: action mapping question
Hmm This sound like it is the way 1.0 of struts was implemented. I haven't use 1.0 for quite sometime so I don't remember. But, there is something you can do. You can set the attribute validate=false, so that the controller don't have to call the validate method on your from bean. You Don't have to implement the validate method on your from bean, but if you do return null or empty actionErrors. As for input, I don't think you need to provide one. Sorry if I didn't help you in anyway:) Danny Ps. Move to 1.1 -Original Message- From: Darren McGuinness [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 9:24 AM To: Struts Users Mailing List Subject: Re: action mapping question 1) I dont need a logoff form, but if i dont have one then i get errors of type: form bean null. 2) 1.0 Trieu, Danny wrote: 1) why would you need a logoff form? 2) what version of struts are you using? You don't have to have a form bean declare for an action mapping. The reason it throw the exception Because you have the input attribute setting. With this setting the controller makes assumsion that your mapping has a from bean associate to it and make call to the validate methods. I guess the solution is not to provide from bean mapping and input mapping for your action. danny -Original Message- From: Darren McGuinness [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 8:17 AM To: [EMAIL PROTECTED] Subject: action mapping question Hi, Having a few problems getting my application working properly. Basically I've got a logon.jsp page which posts to logon.do action, which then validates and if successfull outputs search.jsp (shows in the browser as /logon.do ). then on search.jsp i have 2 forms, one to search.do and one to logoff.do here's my action mapping for logoff: action path=/logoff type=struts1.action.LogoffAction name=logoffForm input=/logon.do scope=request forward name=success path=/logon.jsp/ forward name=failure path=/logon.jsp/ /action first of all, i dont want to use a bean for the logoff action but it complains otherwise, so for now i've used a form with a attribute dummy with get/set/reset/validate methodsis there a way not to have to do this? if i dont have a form, I get an exception complaining the form bean is null. second, what should 'input' be? if i leave it as /logon.do then it works, but also if i put it as /tapssearch.jsp it works..so what should it be? and how can i set action-mapping to accept input from any page, seeing as for example i'll want to be able to log-off from any one of the pages(bar the logon one of course!) So that i dont have to write an action mapping for every page that has a logoff form cheers -- 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: action mapping question
You shouldn't have to have a form bean. Here's the global forward I use for the logout action: forward name=forward.logout path=/exec/logout/ Here's my action mapping for my logout action (Struts 1.0.2, with Tiles): action path=/logout type=com.sprintpcs.ptt.controller.authentication.LogoutAction forward name=forward.success path=template.login/ /action The action class is short n' sweet (my abstract ActionSupport class overrides Action's perform() method and then calls the abstract execute() method): public class LogoutAction extends ActionSupport { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession session = request.getSession(); if (session != null) { session.removeAttribute(USER_OBJECT_SESSION_ATTRIBUTE_KEY); session.invalidate(); } return mapping.findForward(SUCCESS); } } So, then, all you need to do to let the user logout is provide a simple link like this: html:link forward=forward.logoutbean:message key=key.logout//html:link That should do it! Hope this helps, chris -Original Message- From: Darren McGuinness [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 10:17 AM To: [EMAIL PROTECTED] Subject: action mapping question Hi, Having a few problems getting my application working properly. Basically I've got a logon.jsp page which posts to logon.do action, which then validates and if successfull outputs search.jsp (shows in the browser as /logon.do ). then on search.jsp i have 2 forms, one to search.do and one to logoff.do here's my action mapping for logoff: action path=/logoff type=struts1.action.LogoffAction name=logoffForm input=/logon.do scope=request forward name=success path=/logon.jsp/ forward name=failure path=/logon.jsp/ /action first of all, i dont want to use a bean for the logoff action but it complains otherwise, so for now i've used a form with a attribute dummy with get/set/reset/validate methodsis there a way not to have to do this? if i dont have a form, I get an exception complaining the form bean is null. second, what should 'input' be? if i leave it as /logon.do then it works, but also if i put it as /tapssearch.jsp it works..so what should it be? and how can i set action-mapping to accept input from any page, seeing as for example i'll want to be able to log-off from any one of the pages(bar the logon one of course!) So that i dont have to write an action mapping for every page that has a logoff form cheers -- 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: action mapping question
The html:form tag expects there to be a ActionForm bean associated with the form. If you are using a button-only form, you still need to provide an ActionForm bean, even if it is an empty implementation. I generally keep one of these in my Struts toolkit to use throughout an application. Or, you could just use whatever bean is handy. You don't need a bean with an Action, but you do need one to appease the html:form tag. -Ted. then on search.jsp i have 2 forms, one to search.do and one to logoff.do here's my action mapping for logoff: action path=/logoff type=struts1.action.LogoffAction name=logoffForm input=/logon.do scope=request forward name=success path=/logon.jsp/ forward name=failure path=/logon.jsp/ /action first of all, i dont want to use a bean for the logoff action but it complains otherwise, so for now i've used a form with a attribute dummy with get/set/reset/validate methodsis there a way not to have to do this? if i dont have a form, I get an exception complaining the form bean is null. second, what should 'input' be? if i leave it as /logon.do then it works, but also if i put it as /tapssearch.jsp it works..so what should it be? and how can i set action-mapping to accept input from any page, seeing as for example i'll want to be able to log-off from any one of the pages(bar the logon one of course!) So that i dont have to write an action mapping for every page that has a logoff form cheers -- 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]
action mapping error (2nd post)
re Hi, i done the following intallations: - sdk 1.4 - j2ee 1.3.1 - Tomcat 4.0.4 - Struts 1.0.2 - Eclipse 2.0 - Tomcat eclipse plugin - Easy struts eclipse plugin - struts config file editor. I made a simple application, that asks for a login and a passsword. - I launch tomcat - I launch my web navigator - http://localhos:8080/myApp/form/userLoginForm.jsp = An error occured Cannot find ActionMappings or ActionFormBeans collection Any idea. I installed nothing more that i describe on top thanks in advance Fred
Re: action mapping error (2nd post)
Hi Frederic, Usually when I get this error it means something is amiss in the web.xml file, either it cannot be parsed because of unexpected elements or cannot be found at all. Check the output from the console where you started tomcat from, it should give you some clues. Adrian --- Frederic Barozzi [EMAIL PROTECTED] wrote: re Hi, i done the following intallations: - sdk 1.4 - j2ee 1.3.1 - Tomcat 4.0.4 - Struts 1.0.2 - Eclipse 2.0 - Tomcat eclipse plugin - Easy struts eclipse plugin - struts config file editor. I made a simple application, that asks for a login and a passsword. - I launch tomcat - I launch my web navigator - http://localhos:8080/myApp/form/userLoginForm.jsp = An error occured Cannot find ActionMappings or ActionFormBeans collection Any idea. I installed nothing more that i describe on top thanks in advance Fred http://digital.yahoo.com.au - Yahoo! Digital How To - Get the best out of your PC! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cannot find action mapping
STRUTS people, this is bizzare, but I have come to expect this in my travels. so any hints as to what the problem may be would be great! I am using tomcat 4.1.3 I have a struts application in $CATALINA_HOME/webapps/test, it has the following stuff in it... test home.jsp index.jsp register.jsp WEB-INF struts-bean.tld struts-form.tld struts-logic.tld struts.tld struts-config.xml struts-html.tld struts-template.tld web.xml lib mm.mysql-2.0.14-bin.jar struts.jar classes com noi webapp test action RegisterAction.class display UserData.class form RegisterForm.class my struts-config.xml file looks like: ?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; struts-config !-- == data source Definitions == -- data-sources data-source set-property property=autoCommit value=false / set-property property=description value=The Test Datasource / set-property property=driverClass value=org.gjt.mm.mysql.Driver / set-property property=maxCount value=4 / set-property property=minCount value=2 / set-property property=password value= / set-property property=url value=jdbc:mysql://localhost/test / set-property property=user value=root / /data-source /data-sources !-- == form Definitions == -- form-beans form-bean name=registerForm type=com.noi.webapp.test.form.RegisterForm/ /form-beans !-- == Global Forward Definitions == -- global-forwards forward name=registerform path=/register.jsp/ /global-forwards !-- == action Definitions == -- action-mappings action path=/register type=com.noi.webapp.test.action.RegisterAction name=registerForm forward name=home path=/home.jsp/ /action /action-mappings /struts-config this is coming out of the catalina.out log when tomcat starts up... register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar:file:/home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/lib/str uts.jar!/org/apache/struts/resources/struts-config_1_0.dtd' register('-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN', 'jar:file:/home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/lib/str uts.jar!/org/apache/struts/resources/web-app_2_2.dtd' register('-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN', 'jar:file:/home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/lib/str uts.jar!/org/apache/struts/resources/web-app_2_3.dtd' resolveEntity('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd') Resolving to alternate DTD 'jar:file:/home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/lib/str uts.jar!/org/apache/struts/resources/struts-config_1_0.dtd' New org.apache.struts.util.GenericDataSource Set org.apache.struts.util.GenericDataSource properties Call org.apache.struts.action.ActionServlet.addDataSource(org.apache.struts.a ction.DATA_SOURCE, GenericDataSource[activeCount=0, autoCommit=true, closed=false, driverClass=null, loginTimeout=0, maxCount=2, minCount=1, password=null, readOnly=false, url=null, useCount=0, user=null]) Set org.apache.struts.util.GenericDataSource property autoCommit to false Set org.apache.struts.util.GenericDataSource property description to The Test Datasource Set org.apache.struts.util.GenericDataSource property driverClass to org.gjt.mm.mysql.Driver Set org.apache.struts.util.GenericDataSource property maxCount to 4 Set org.apache.struts.util.GenericDataSource property minCount to 2 Set org.apache.struts.util.GenericDataSource property password to Set org.apache.struts.util.GenericDataSource property url to jdbc:mysql://localhost/test Set org.apache.struts.util.GenericDataSource property user to root Pop org.apache.struts.util.GenericDataSource New org.apache.struts.action.ActionFormBean Set org.apache.struts.action.ActionFormBean properties Call org.apache.struts.action.ActionServlet.addFormBean(ActionFormBean[regist erForm]) Pop org.apache.struts.action.ActionFormBean New org.apache.struts.action.ActionForward Set
RE: cannot find action mapping
Just a follow up, I figured out the problem, basically the datasource is failing. When I look at the log file for the context I get the following error: 2002-07-10 18:13:42 WebappLoader[/test]: Deploying class repositories to work directory /home/tomcat/jakarta-tomcat-4.1.3/work/Standalone/localhost/test 2002-07-10 18:13:42 WebappLoader[/test]: Deploy class files /WEB-INF/classes to /home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/classes 2002-07-10 18:13:42 WebappLoader[/test]: Deploy JAR /WEB-INF/lib/mm.mysql-2.0.14-bin.jar to /home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/lib/mm.mysql-2.0. 14-bin.jar 2002-07-10 18:13:42 WebappLoader[/test]: Deploy JAR /WEB-INF/lib/struts.jar to /home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/lib/struts.jar 2002-07-10 18:13:42 StandardManager[/test]: Seeding random number generator class java.security.SecureRandom 2002-07-10 18:13:42 StandardManager[/test]: Seeding of random number generator has been completed 2002-07-10 18:13:43 StandardWrapper[/test:default]: Loading container servlet default 2002-07-10 18:13:43 default: init 2002-07-10 18:13:43 StandardWrapper[/test:invoker]: Loading container servlet invoker 2002-07-10 18:13:43 invoker: init 2002-07-10 18:13:43 action: init 2002-07-10 18:13:43 action: Loading application resources from resource org.apache.struts.webapp.example.ApplicationResources 2002-07-10 18:13:43 action: Initializing configuration from resource path /WEB-INF/struts-config.xml 2002-07-10 18:13:43 action: Initializing application data source org.apache.struts.action.DATA_SOURCE 2002-07-10 18:13:43 action: Exception initializing application data source org.apache.struts.action.DATA_SOURCE java.sql.SQLException: Server configuration denies access to data source at org.gjt.mm.mysql.MysqlIO.init(Unknown Source) at org.gjt.mm.mysql.Connection.connectionInit(Unknown Source) at org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Unknown Source) at org.gjt.mm.mysql.Driver.connect(Unknown Source) at org.apache.struts.util.GenericDataSource.createConnection(GenericDataSou rce.java:731) at org.apache.struts.util.GenericDataSource.open(GenericDataSource.java:668) at org.apache.struts.action.ActionServlet.initDataSources(ActionServlet.jav a:1078) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav a:919) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:811) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j ava:3293) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3486) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1190) at org.apache.catalina.core.StandardHost.start(StandardHost.java :740) if I comment the datasource out, the actionmapping works. I know the sql driver is both in my $CATALINA_HOME/webapps/test/WEB-INF/lib (as well as in my $CATALINA_HOME/common/lib). is it possible that I need to update the version of mysql to match the driver? Clay -Original Message- From: Clay Graham [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 2:47 PM To: '[EMAIL PROTECTED]' Subject:cannot find action mapping STRUTS people, this is bizzare, but I have come to expect this in my travels. so any hints as to what the problem may be would be great! I am using tomcat 4.1.3 I have a struts application in $CATALINA_HOME/webapps/test, it has the following stuff in it... test home.jsp index.jsp register.jsp WEB-INF struts-bean.tld struts-form.tld struts-logic.tld struts.tld struts-config.xml struts-html.tld struts-template.tld web.xml lib mm.mysql-2.0.14-bin.jar struts.jar classes com noi webapp test action RegisterAction.class display UserData.class form RegisterForm.class my struts-config.xml file looks like: ?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; struts-config !-- == data source Definitions == -- data-sources data-source set-property property=autoCommit value=false / set
RE: cannot find action mapping
more info: mysql version:MySQL 3.23.36 running on localhost JDBC driver:mm.mysql-2.0.14-bin.jar has anyone had problems with this combo? clay -Original Message- From: Clay Graham [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 3:15 PM To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Subject:RE: cannot find action mapping Just a follow up, I figured out the problem, basically the datasource is failing. When I look at the log file for the context I get the following error: 2002-07-10 18:13:42 WebappLoader[/test]: Deploying class repositories to work directory /home/tomcat/jakarta-tomcat-4.1.3/work/Standalone/localhost/test 2002-07-10 18:13:42 WebappLoader[/test]: Deploy class files /WEB-INF/classes to /home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/classes 2002-07-10 18:13:42 WebappLoader[/test]: Deploy JAR /WEB-INF/lib/mm.mysql-2.0.14-bin.jar to /home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/lib/mm.mysql-2.0. 14-bin.jar 2002-07-10 18:13:42 WebappLoader[/test]: Deploy JAR /WEB-INF/lib/struts.jar to /home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/lib/struts.jar 2002-07-10 18:13:42 StandardManager[/test]: Seeding random number generator class java.security.SecureRandom 2002-07-10 18:13:42 StandardManager[/test]: Seeding of random number generator has been completed 2002-07-10 18:13:43 StandardWrapper[/test:default]: Loading container servlet default 2002-07-10 18:13:43 default: init 2002-07-10 18:13:43 StandardWrapper[/test:invoker]: Loading container servlet invoker 2002-07-10 18:13:43 invoker: init 2002-07-10 18:13:43 action: init 2002-07-10 18:13:43 action: Loading application resources from resource org.apache.struts.webapp.example.ApplicationResources 2002-07-10 18:13:43 action: Initializing configuration from resource path /WEB-INF/struts-config.xml 2002-07-10 18:13:43 action: Initializing application data source org.apache.struts.action.DATA_SOURCE 2002-07-10 18:13:43 action: Exception initializing application data source org.apache.struts.action.DATA_SOURCE java.sql.SQLException: Server configuration denies access to data source at org.gjt.mm.mysql.MysqlIO.init(Unknown Source) at org.gjt.mm.mysql.Connection.connectionInit(Unknown Source) at org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Unknown Source) at org.gjt.mm.mysql.Driver.connect(Unknown Source) at org.apache.struts.util.GenericDataSource.createConnection(GenericDataSou rce.java:731) at org.apache.struts.util.GenericDataSource.open(GenericDataSource.java:668) at org.apache.struts.action.ActionServlet.initDataSources(ActionServlet.jav a:1078) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav a:919) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:811) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j ava:3293) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3486) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1190) at org.apache.catalina.core.StandardHost.start(StandardHost.java :740) if I comment the datasource out, the actionmapping works. I know the sql driver is both in my $CATALINA_HOME/webapps/test/WEB-INF/lib (as well as in my $CATALINA_HOME/common/lib). is it possible that I need to update the version of mysql to match the driver? Clay -Original Message- From: Clay Graham [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 2:47 PM To: '[EMAIL PROTECTED]' Subject:cannot find action mapping STRUTS people, this is bizzare, but I have come to expect this in my travels. so any hints as to what the problem may be would be great! I am using tomcat 4.1.3 I have a struts application in $CATALINA_HOME/webapps/test, it has the following stuff in it... test home.jsp index.jsp register.jsp WEB-INF struts-bean.tld struts-form.tld struts-logic.tld struts.tld struts-config.xml struts-html.tld struts-template.tld web.xml lib mm.mysql-2.0.14-bin.jar struts.jar classes com noi webapp test action RegisterAction.class display UserData.class form RegisterForm.class my struts-config.xml file looks like: ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts
Passing a parameter into an action from the action mapping?
I thought I saw a solution for this somewhere but I cannot find it... I have the following set up... action-mappings action path=/index parameter= unknown=true forward=plantsec.mainmenu forward name=success path=plantsec.mainmenu redirect=false / /action action path=/todo parameter= forward=plantsec.todo / action path=/createNew parameter= type=com.ebind.plantsec.create.actionCreateNew name=formNewRequest input=plantsec.create.new scope=request forward name=continue path=plantsec.create.new redirect=false / forward name=success path=plantsec.mainmenu redirect=false / /action action path=/search parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search1w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search2w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search4w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllFuture parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllPast parameter= type=com.ebind.plantsec.search.actionSearch / /action-mappings All of my calls to Search are the same, just with a different duration. I was looking at dispatch, but these are all from links so I would need to do /search.do?dur=1week Is there a way in the action mapping to say when they go to /search1w.do it forwards them into the same action with some sort of parameter? Or is it just a dumb ass idea and should I just do the dispatch? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Passing a parameter into an action from the action mapping?
At 4:11 PM -0400 2002/06/18, [EMAIL PROTECTED] wrote: I thought I saw a solution for this somewhere but I cannot find it... set the value of the parameter attribute, then use mapping.getParameter() in the action. It's not a dumb idea at all -- it's the kind of reusability that Struts makes easy... Joe I have the following set up... action-mappings action path=/index parameter= unknown=true forward=plantsec.mainmenu forward name=success path=plantsec.mainmenu redirect=false / /action action path=/todo parameter= forward=plantsec.todo / action path=/createNew parameter= type=com.ebind.plantsec.create.actionCreateNew name=formNewRequest input=plantsec.create.new scope=request forward name=continue path=plantsec.create.new redirect=false / forward name=success path=plantsec.mainmenu redirect=false / /action action path=/search parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search1w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search2w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search4w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllFuture parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllPast parameter= type=com.ebind.plantsec.search.actionSearch / /action-mappings All of my calls to Search are the same, just with a different duration. I was looking at dispatch, but these are all from links so I would need to do /search.do?dur=1week Is there a way in the action mapping to say when they go to /search1w.do it forwards them into the same action with some sort of parameter? Or is it just a dumb ass idea and should I just do the dispatch? -- 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: Passing a parameter into an action from the action mapping?
The parameter that Joe is talking about is for the action tag in your struts-config.xml. Take a look at the Struts Console. It makes setting all this stuff a breeeze. http://www.jamesholmes.com/struts/ -james [EMAIL PROTECTED] --- Joe Germuska [EMAIL PROTECTED] wrote: At 4:11 PM -0400 2002/06/18, [EMAIL PROTECTED] wrote: I thought I saw a solution for this somewhere but I cannot find it... set the value of the parameter attribute, then use mapping.getParameter() in the action. It's not a dumb idea at all -- it's the kind of reusability that Struts makes easy... Joe I have the following set up... action-mappings action path=/index parameter= unknown=true forward=plantsec.mainmenu forward name=success path=plantsec.mainmenu redirect=false / /action action path=/todo parameter= forward=plantsec.todo / action path=/createNew parameter= type=com.ebind.plantsec.create.actionCreateNew name=formNewRequest input=plantsec.create.new scope=request forward name=continue path=plantsec.create.new redirect=false / forward name=success path=plantsec.mainmenu redirect=false / /action action path=/search parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search1w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search2w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search4w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllFuture parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllPast parameter= type=com.ebind.plantsec.search.actionSearch / /action-mappings All of my calls to Search are the same, just with a different duration. I was looking at dispatch, but these are all from links so I would need to do /search.do?dur=1week Is there a way in the action mapping to say when they go to /search1w.do it forwards them into the same action with some sort of parameter? Or is it just a dumb ass idea and should I just do the dispatch? -- 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] __ 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: Passing a parameter into an action from the action mapping?
Doh! I tried that with request.getParameter() Duh - the difference is wonderfully obvious now! Thanks -Original Message- From: Joe [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 4:10 PM To: struts-user Subject: Re: Passing a parameter into an action from the action mapping? At 4:11 PM -0400 2002/06/18, [EMAIL PROTECTED] wrote: I thought I saw a solution for this somewhere but I cannot find it... set the value of the parameter attribute, then use mapping.getParameter() in the action. It's not a dumb idea at all -- it's the kind of reusability that Struts makes easy... Joe I have the following set up... action-mappings action path=/index parameter= unknown=true forward=plantsec.mainmenu forward name=success path=plantsec.mainmenu redirect=false / /action action path=/todo parameter= forward=plantsec.todo / action path=/createNew parameter= type=com.ebind.plantsec.create.actionCreateNew name=formNewRequest input=plantsec.create.new scope=request forward name=continue path=plantsec.create.new redirect=false / forward name=success path=plantsec.mainmenu redirect=false / /action action path=/search parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search1w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search2w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search4w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllFuture parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllPast parameter= type=com.ebind.plantsec.search.actionSearch / /action-mappings All of my calls to Search are the same, just with a different duration. I was looking at dispatch, but these are all from links so I would need to do /search.do?dur=1week Is there a way in the action mapping to say when they go to /search1w.do it forwards them into the same action with some sort of parameter? Or is it just a dumb ass idea and should I just do the dispatch? -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Passing a parameter into an action from the action mapping?
Already there... The only thing that I would love to see in struts console is if I view source having it on more than one line... In my development environment (windows) there is no line feeds or anything -Original Message- From: jholmes612 [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 4:18 PM To: struts-user Subject: Re: Passing a parameter into an action from the action mapping? The parameter that Joe is talking about is for the action tag in your struts-config.xml. Take a look at the Struts Console. It makes setting all this stuff a breeeze. http://www.jamesholmes.com/struts/ -james [EMAIL PROTECTED] --- Joe Germuska [EMAIL PROTECTED] wrote: At 4:11 PM -0400 2002/06/18, [EMAIL PROTECTED] wrote: I thought I saw a solution for this somewhere but I cannot find it... set the value of the parameter attribute, then use mapping.getParameter() in the action. It's not a dumb idea at all -- it's the kind of reusability that Struts makes easy... Joe I have the following set up... action-mappings action path=/index parameter= unknown=true forward=plantsec.mainmenu forward name=success path=plantsec.mainmenu redirect=false / /action action path=/todo parameter= forward=plantsec.todo / action path=/createNew parameter= type=com.ebind.plantsec.create.actionCreateNew name=formNewRequest input=plantsec.create.new scope=request forward name=continue path=plantsec.create.new redirect=false / forward name=success path=plantsec.mainmenu redirect=false / /action action path=/search parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search1w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search2w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search4w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllFuture parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllPast parameter= type=com.ebind.plantsec.search.actionSearch / /action-mappings All of my calls to Search are the same, just with a different duration. I was looking at dispatch, but these are all from links so I would need to do /search.do?dur=1week Is there a way in the action mapping to say when they go to /search1w.do it forwards them into the same action with some sort of parameter? Or is it just a dumb ass idea and should I just do the dispatch? -- 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] __ 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: Passing a parameter into an action from the action mapping?
Hmm try using the Output Options underneath the Options menu in the standalone version (1.12 and later). -james [EMAIL PROTECTED] http://www.jamesholmes.com/struts/ --- [EMAIL PROTECTED] wrote: Already there... The only thing that I would love to see in struts console is if I view source having it on more than one line... In my development environment (windows) there is no line feeds or anything -Original Message- From: jholmes612 [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 4:18 PM To: struts-user Subject: Re: Passing a parameter into an action from the action mapping? The parameter that Joe is talking about is for the action tag in your struts-config.xml. Take a look at the Struts Console. It makes setting all this stuff a breeeze. http://www.jamesholmes.com/struts/ -james [EMAIL PROTECTED] --- Joe Germuska [EMAIL PROTECTED] wrote: At 4:11 PM -0400 2002/06/18, [EMAIL PROTECTED] wrote: I thought I saw a solution for this somewhere but I cannot find it... set the value of the parameter attribute, then use mapping.getParameter() in the action. It's not a dumb idea at all -- it's the kind of reusability that Struts makes easy... Joe I have the following set up... action-mappings action path=/index parameter= unknown=true forward=plantsec.mainmenu forward name=success path=plantsec.mainmenu redirect=false / /action action path=/todo parameter= forward=plantsec.todo / action path=/createNew parameter= type=com.ebind.plantsec.create.actionCreateNew name=formNewRequest input=plantsec.create.new scope=request forward name=continue path=plantsec.create.new redirect=false / forward name=success path=plantsec.mainmenu redirect=false / /action action path=/search parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search1w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search2w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search4w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllFuture parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllPast parameter= type=com.ebind.plantsec.search.actionSearch / /action-mappings All of my calls to Search are the same, just with a different duration. I was looking at dispatch, but these are all from links so I would need to do /search.do?dur=1week Is there a way in the action mapping to say when they go to /search1w.do it forwards them into the same action with some sort of parameter? Or is it just a dumb ass idea and should I just do the dispatch? -- 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] __ 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: Passing a parameter into an action from the action mapping?
What are you using to view the file? Notepad? If so, or you just want a quick way to view it (outside of the Console), use Textpad. http://www.textpad.com It's a serious text editor with everything from 'go to' line and/or column, macros for re-use of common tasks, search and replace using regular expressions [based on POSIX standard P1003.2, but the syntax can be that of POSIX, or UNIX extended regular expressions (the default)], block text selection and SORTING!!! I usually associate .xml so that I get syntax highlighting. It's not an IDE, but it has limited support for running javac with 'jump to' for compile errors. 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 18, 2002 4:28 PM To: [EMAIL PROTECTED] Subject: RE: Passing a parameter into an action from the action mapping? Already there... The only thing that I would love to see in struts console is if I view source having it on more than one line... In my development environment (windows) there is no line feeds or anything -Original Message- From: jholmes612 [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 4:18 PM To: struts-user Subject: Re: Passing a parameter into an action from the action mapping? The parameter that Joe is talking about is for the action tag in your struts-config.xml. Take a look at the Struts Console. It makes setting all this stuff a breeeze. http://www.jamesholmes.com/struts/ -james [EMAIL PROTECTED] --- Joe Germuska [EMAIL PROTECTED] wrote: At 4:11 PM -0400 2002/06/18, [EMAIL PROTECTED] wrote: I thought I saw a solution for this somewhere but I cannot find it... set the value of the parameter attribute, then use mapping.getParameter() in the action. It's not a dumb idea at all -- it's the kind of reusability that Struts makes easy... Joe I have the following set up... action-mappings action path=/index parameter= unknown=true forward=plantsec.mainmenu forward name=success path=plantsec.mainmenu redirect=false / /action action path=/todo parameter= forward=plantsec.todo / action path=/createNew parameter= type=com.ebind.plantsec.create.actionCreateNew name=formNewRequest input=plantsec.create.new scope=request forward name=continue path=plantsec.create.new redirect=false / forward name=success path=plantsec.mainmenu redirect=false / /action action path=/search parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search1w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search2w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search4w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllFuture parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllPast parameter= type=com.ebind.plantsec.search.actionSearch / /action-mappings All of my calls to Search are the same, just with a different duration. I was looking at dispatch, but these are all from links so I would need to do /search.do?dur=1week Is there a way in the action mapping to say when they go to /search1w.do it forwards them into the same action with some sort of parameter? Or is it just a dumb ass idea and should I just do the dispatch? -- 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] __ 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Passing a parameter into an action from the action mapping?
I installed 1.11 a few days before you released 1.12... Have not had time to upgrade yet. Thanks, I'll try it -Original Message- From: jholmes612 [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 4:32 PM To: struts-user Subject: RE: Passing a parameter into an action from the action mapping? Hmm try using the Output Options underneath the Options menu in the standalone version (1.12 and later). -james [EMAIL PROTECTED] http://www.jamesholmes.com/struts/ --- [EMAIL PROTECTED] wrote: Already there... The only thing that I would love to see in struts console is if I view source having it on more than one line... In my development environment (windows) there is no line feeds or anything -Original Message- From: jholmes612 [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 4:18 PM To: struts-user Subject: Re: Passing a parameter into an action from the action mapping? The parameter that Joe is talking about is for the action tag in your struts-config.xml. Take a look at the Struts Console. It makes setting all this stuff a breeeze. http://www.jamesholmes.com/struts/ -james [EMAIL PROTECTED] --- Joe Germuska [EMAIL PROTECTED] wrote: At 4:11 PM -0400 2002/06/18, [EMAIL PROTECTED] wrote: I thought I saw a solution for this somewhere but I cannot find it... set the value of the parameter attribute, then use mapping.getParameter() in the action. It's not a dumb idea at all -- it's the kind of reusability that Struts makes easy... Joe I have the following set up... action-mappings action path=/index parameter= unknown=true forward=plantsec.mainmenu forward name=success path=plantsec.mainmenu redirect=false / /action action path=/todo parameter= forward=plantsec.todo / action path=/createNew parameter= type=com.ebind.plantsec.create.actionCreateNew name=formNewRequest input=plantsec.create.new scope=request forward name=continue path=plantsec.create.new redirect=false / forward name=success path=plantsec.mainmenu redirect=false / /action action path=/search parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search1w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search2w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/search4w parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllFuture parameter= type=com.ebind.plantsec.search.actionSearch / action path=/searchAllPast parameter= type=com.ebind.plantsec.search.actionSearch / /action-mappings All of my calls to Search are the same, just with a different duration. I was looking at dispatch, but these are all from links so I would need to do /search.do?dur=1week Is there a way in the action mapping to say when they go to /search1w.do it forwards them into the same action with some sort of parameter? Or is it just a dumb ass idea and should I just do the dispatch? -- 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] __ 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]