RE: *.do ---- Proof of Concepts
To satisfy your questions (maybe), have you read the relevant parts of the API, like the name field in the ActionConfig class (the class replacing ActionMapping)? Mark -Original Message- From: Robert [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 6:08 PM To: 'Struts Users Mailing List' Subject: RE: *.do Proof of Concepts An error of cut and pasting config info :-) That example did have the name, but it really didn't have a form bean in use. -Original Message- From: Marcelo Vanzin [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 4:49 PM To: Struts Users Mailing List Subject: Re: *.do Proof of Concepts Robert wrote: Mark made a good point about omitting the name. I double checked with another app we wrote and I left the name in the tag, but it didn't cause any 'harm'; again no beans or actions. I knew about omitting the name, I just found strange that in your example earlier you told that no form beans were created, although there was a name attribute in the action declaration. -- []'s Marcelo Vanzin Touch Tecnologia [EMAIL PROTECTED] Life is too short to drink cheap beer -- 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: *.do ---- Proof of Concepts
Make a small action that only redirects to its input when the perform() method is called, e.g.: return new ActionForward(mapping.getInput()); Then use it in all you action mappings in the config file, changing the input attribute to the desired JSP. K J wrote: Say I have a web application which contains 1 JSP and I wanted to use Struts. I don't have any action classes, but I want to use the controler servelt and the taglib. Will the *.do work only when you have action classes? What would this entry look like if I only want the Controler servelt to forward to a JSP(without any action classes)? -- []'s Marcelo Vanzin Touch Tecnologia [EMAIL PROTECTED] Life is too short to drink cheap beer -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: *.do ---- Proof of Concepts
Marcelo is exactly correct, and here's an expansion of his explanation showing a sample struts-config: ?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 action-mappings action path=/myJSP type=package.ForwardAction name=sampleForm scope=request input=/WEB-INF/jsp/myJSP.jsp /action /action-mappings /struts-config // In the ForwardAction class: public ActionForward performAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, PASContext ctx, Connection conn, Category cat) throws IOException, ServletException { return (new ActionForward(mapping.getInput())); } -Original Message- From: Marcelo Vanzin [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 11:15 AM To: Struts Users Mailing List Subject: Re: *.do Proof of Concepts Make a small action that only redirects to its input when the perform() method is called, e.g.: return new ActionForward(mapping.getInput()); Then use it in all you action mappings in the config file, changing the input attribute to the desired JSP. K J wrote: Say I have a web application which contains 1 JSP and I wanted to use Struts. I don't have any action classes, but I want to use the controler servelt and the taglib. Will the *.do work only when you have action classes? What would this entry look like if I only want the Controler servelt to forward to a JSP(without any action classes)? -- []'s Marcelo Vanzin Touch Tecnologia [EMAIL PROTECTED] Life is too short to drink cheap beer -- 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: *.do ---- Proof of Concepts
So what you guys are saying is that it won't work without the action class? instead of *.do, can I just put *.* or *.jsp ? i.e. !-- Action Servlet Mapping -- servlet-mapping servlet-nameaction/servlet-name url-pattern*.*/url-pattern /servlet-mapping I'm trying to see if I can do this(*.do) without any action classes. many thanks! --- Joseph Barefoot [EMAIL PROTECTED] wrote: Marcelo is exactly correct, and here's an expansion of his explanation showing a sample struts-config: ?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 action-mappings action path=/myJSP type=package.ForwardAction name=sampleForm scope=request input=/WEB-INF/jsp/myJSP.jsp /action /action-mappings /struts-config // In the ForwardAction class: public ActionForward performAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, PASContext ctx, Connection conn, Category cat) throws IOException, ServletException { return (new ActionForward(mapping.getInput())); } -Original Message- From: Marcelo Vanzin [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 11:15 AM To: Struts Users Mailing List Subject: Re: *.do Proof of Concepts Make a small action that only redirects to its input when the perform() method is called, e.g.: return new ActionForward(mapping.getInput()); Then use it in all you action mappings in the config file, changing the input attribute to the desired JSP. K J wrote: Say I have a web application which contains 1 JSP and I wanted to use Struts. I don't have any action classes, but I want to use the controler servelt and the taglib. Will the *.do work only when you have action classes? What would this entry look like if I only want the Controler servelt to forward to a JSP(without any action classes)? -- []'s Marcelo Vanzin Touch Tecnologia [EMAIL PROTECTED] Life is too short to drink cheap beer -- 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! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: *.do ---- Proof of Concepts
wow, i didn't know that. i thought since i had this mapping entry(below) in my web.xml, all the requests to the jsp would get intercepted by the ActionServlet! !-- Action Servlet Mapping -- servlet-mapping servlet-nameaction/servlet-name url-pattern*.*/url-pattern /servlet-mapping I was ablet to use the tags, so I guess the tag libraries have nothing to do with the ActionServlet, right? So in my case, the requests have not been going through the ActionServlet? damn! --- Marcelo Vanzin [EMAIL PROTECTED] wrote: K J wrote: So what you guys are saying is that it won't work without the action class? instead of *.do, can I just put *.* or *.jsp ? Exactly. If you're mapping something to the ActionServlet, you are saying that you have an Action to be executed. You can't bypass the action if you are using the default ActionServlet. Maybe it is possible to extend the ActionServlet and make it so that you don't need to call the Action, but that is not Struts' default behaviour, and that is why you need that façade action for what you want to do. -- []'s Marcelo Vanzin Touch Tecnologia [EMAIL PROTECTED] Life is too short to drink cheap beer -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: *.do ---- Proof of Concepts
I beleive you are correct. Do you have a form bean that is being populated? If not, and the taglib is useful to you without the controller, is there any reason for you to use the controller in this case? A controller doesn't really buy you anything if you have no business logic to invoke and only one page. Greg -Original Message- From: K J [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 1:51 PM To: Struts Users Mailing List Subject: Re: *.do Proof of Concepts wow, i didn't know that. i thought since i had this mapping entry(below) in my web.xml, all the requests to the jsp would get intercepted by the ActionServlet! !-- Action Servlet Mapping -- servlet-mapping servlet-nameaction/servlet-name url-pattern*.*/url-pattern /servlet-mapping I was ablet to use the tags, so I guess the tag libraries have nothing to do with the ActionServlet, right? So in my case, the requests have not been going through the ActionServlet? damn! --- Marcelo Vanzin [EMAIL PROTECTED] wrote: K J wrote: So what you guys are saying is that it won't work without the action class? instead of *.do, can I just put *.* or *.jsp ? Exactly. If you're mapping something to the ActionServlet, you are saying that you have an Action to be executed. You can't bypass the action if you are using the default ActionServlet. Maybe it is possible to extend the ActionServlet and make it so that you don't need to call the Action, but that is not Struts' default behaviour, and that is why you need that façade action for what you want to do. -- []'s Marcelo Vanzin Touch Tecnologia [EMAIL PROTECTED] Life is too short to drink cheap beer -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.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: *.do ---- Proof of Concepts
Struts has a class org.apache.struts.actions.ForwardAction that will probably fill your need. In your web.xml, you can leave the default *.do configuration as is. In your struts-config.xml, add the following action (in the actionmappings section), and replace the 'parameter' with the jsp file you want to forward to (and the /test with whatever you would like to call your action): action-mappings actionpath=/test type=org.apache.struts.actions.ForwardAction name=whateveryouwanttocallit parameter=/index.jsp /action /action-mappings Restart, and now if you issue a /test.do you will be redirected to your jsp page (through the controller). This way, you don't have to create an action class, but you still can use the controller. See the javadoc on the ForwardAction class for more. -Manish -Original Message- From: K J [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:04 PM To: Struts Users Mailing List Subject: *.do Proof of Concepts Say I have a web application which contains 1 JSP and I wanted to use Struts. I don't have any action classes, but I want to use the controler servelt and the taglib. Will the *.do work only when you have action classes? What would this entry look like if I only want the Controler servelt to forward to a JSP(without any action classes)? can you tell me what needs to go where(i.e. web.xml vs. struts-config.xml). what should go in the global forward path, and the servelet-mapping section? Thanks. = __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.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: *.do ---- Proof of Concepts
K J wrote: i thought since i had this mapping entry(below) in my web.xml, all the requests to the jsp would get intercepted by the ActionServlet! !-- Action Servlet Mapping -- servlet-mapping servlet-nameaction/servlet-name url-pattern*.*/url-pattern /servlet-mapping They will, if you change the URL pattern to /*. But that's not the problem: once the ActionServlet intercepts it, you'll have to have a mapping in the config file for that request, so that Struts knows what to do. And, once you have a mapping, you need to have an Action (unless you extend the ActionServlet the way I mentioned earlier, if it is possible to change this behaviour - I don't know). -- []'s Marcelo Vanzin Touch Tecnologia [EMAIL PROTECTED] Life is too short to drink cheap beer -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: *.do ---- Proof of Concepts
Actually, you can use .do without actions. This snippet is from a demo app that we have: action name=searchCustomer path=/searchCustomer forward=/searchCustomer.jsp / where the url would be searchCustomer.do and there are no actions and no formbeans for the resulting page (searchCustomer.jsp). I use this quite a bit actually myself where I believe in abstracting out the url links in the pages from the actual locations/page names; meaning I can change the searchCustomer.jsp page to some other page and not have to go through all my pages and update links. In this scenario the ActionServlet is a traffic controller for the pages. You could even do this in a completely non-action website, and would make sense in a really large site that gets updated a frequently. - Robert -Original Message- From: K J [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 1:04 PM To: Struts Users Mailing List Subject: *.do Proof of Concepts Say I have a web application which contains 1 JSP and I wanted to use Struts. I don't have any action classes, but I want to use the controler servelt and the taglib. Will the *.do work only when you have action classes? What would this entry look like if I only want the Controler servelt to forward to a JSP(without any action classes)? can you tell me what needs to go where(i.e. web.xml vs. struts-config.xml). what should go in the global forward path, and the servelet-mapping section? Thanks. = __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.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: *.do ---- Proof of Concepts
Ya don't say? Thanks for the info., I had no idea you could do that. Joe Barefoot -Original Message- From: Robert [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:00 PM To: 'Struts Users Mailing List' Subject: RE: *.do Proof of Concepts Actually, you can use .do without actions. This snippet is from a demo app that we have: action name=searchCustomer path=/searchCustomer forward=/searchCustomer.jsp / where the url would be searchCustomer.do and there are no actions and no formbeans for the resulting page (searchCustomer.jsp). I use this quite a bit actually myself where I believe in abstracting out the url links in the pages from the actual locations/page names; meaning I can change the searchCustomer.jsp page to some other page and not have to go through all my pages and update links. In this scenario the ActionServlet is a traffic controller for the pages. You could even do this in a completely non-action website, and would make sense in a really large site that gets updated a frequently. - Robert -Original Message- From: K J [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 1:04 PM To: Struts Users Mailing List Subject: *.do Proof of Concepts Say I have a web application which contains 1 JSP and I wanted to use Struts. I don't have any action classes, but I want to use the controler servelt and the taglib. Will the *.do work only when you have action classes? What would this entry look like if I only want the Controler servelt to forward to a JSP(without any action classes)? can you tell me what needs to go where(i.e. web.xml vs. struts-config.xml). what should go in the global forward path, and the servelet-mapping section? Thanks. = __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.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: *.do ---- Proof of Concepts
Robert wrote: action name=searchCustomer path=/searchCustomer forward=/searchCustomer.jsp / where the url would be searchCustomer.do and there are no actions and no formbeans for the resulting page (searchCustomer.jsp). Interesting, I did not know this. But, you say that no form beans are created. Is that so? What about the name attribute? The original poster wanted this to be able to use the Struts tags without going through an action. But, if using this the form bean is not created, many tags will not work. (BTW, I just checked the DTD, and it says no action is instantiated, but says nothing about form beans). -- []'s Marcelo Vanzin Touch Tecnologia [EMAIL PROTECTED] Life is too short to drink cheap beer -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: *.do ---- Proof of Concepts
If you don't want to use a bean, omit the name, but you will need a path to map to the HTML form. Mark -Original Message- From: Marcelo Vanzin [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 5:09 PM To: Struts Users Mailing List Subject: Re: *.do Proof of Concepts Robert wrote: action name=searchCustomer path=/searchCustomer forward=/searchCustomer.jsp / where the url would be searchCustomer.do and there are no actions and no formbeans for the resulting page (searchCustomer.jsp). Interesting, I did not know this. But, you say that no form beans are created. Is that so? What about the name attribute? The original poster wanted this to be able to use the Struts tags without going through an action. But, if using this the form bean is not created, many tags will not work. (BTW, I just checked the DTD, and it says no action is instantiated, but says nothing about form beans). -- []'s Marcelo Vanzin Touch Tecnologia [EMAIL PROTECTED] Life is too short to drink cheap beer -- 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: *.do ---- Proof of Concepts
Mark made a good point about omitting the name. I double checked with another app we wrote and I left the name in the tag, but it didn't cause any 'harm'; again no beans or actions. You are correct that many tags won't work without using formbeans, such as the html:form tag (unless it's changed). We did one app that was a read only app and hence no form beans were used, but we had actions that invoked our script engine for doing DB stuff, but again, we still had .do urls with no actions or form beans in them. - Robert -Original Message- From: Marcelo Vanzin [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 4:09 PM To: Struts Users Mailing List Subject: Re: *.do Proof of Concepts Robert wrote: action name=searchCustomer path=/searchCustomer forward=/searchCustomer.jsp / where the url would be searchCustomer.do and there are no actions and no formbeans for the resulting page (searchCustomer.jsp). Interesting, I did not know this. But, you say that no form beans are created. Is that so? What about the name attribute? The original poster wanted this to be able to use the Struts tags without going through an action. But, if using this the form bean is not created, many tags will not work. (BTW, I just checked the DTD, and it says no action is instantiated, but says nothing about form beans). -- []'s Marcelo Vanzin Touch Tecnologia [EMAIL PROTECTED] Life is too short to drink cheap beer -- 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: *.do ---- Proof of Concepts
Robert wrote: Mark made a good point about omitting the name. I double checked with another app we wrote and I left the name in the tag, but it didn't cause any 'harm'; again no beans or actions. I knew about omitting the name, I just found strange that in your example earlier you told that no form beans were created, although there was a name attribute in the action declaration. -- []'s Marcelo Vanzin Touch Tecnologia [EMAIL PROTECTED] Life is too short to drink cheap beer -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: *.do ---- Proof of Concepts
An error of cut and pasting config info :-) That example did have the name, but it really didn't have a form bean in use. -Original Message- From: Marcelo Vanzin [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 4:49 PM To: Struts Users Mailing List Subject: Re: *.do Proof of Concepts Robert wrote: Mark made a good point about omitting the name. I double checked with another app we wrote and I left the name in the tag, but it didn't cause any 'harm'; again no beans or actions. I knew about omitting the name, I just found strange that in your example earlier you told that no form beans were created, although there was a name attribute in the action declaration. -- []'s Marcelo Vanzin Touch Tecnologia [EMAIL PROTECTED] Life is too short to drink cheap beer -- 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]