Can a a href be made to function as a 'submit'
Hi: Can a a href be made to function as a 'submit' and upon submission, all the formBean properties are remembered in the Action class that handles it. When I try to use just the a href I can't get the formBean properties to be remembered. But I can't change my list of a href as submit buttons because I need to pass arguments on each of the a href. Here's an example of what I try to do on my JSP page: When the user clicks a link to see a picture of an item, this JSP will be replaced by another JSP with the picture. So before I leave this page, I must save the Personal information and the item list in a temporary location so when I return to this page, those values will be repopulated. But my problem is, clicking the a href link will not carry over he formBean properties to the Action class for me to save. 'Submit' will but I can't change those a href to 'submit' because I need to pass the item index (0,1,2 etc.) through each a href to the Action class. Personal information: First Name: Last Name: Mailing Address: List of items in your shopping cart: ABC tennis racket 1 a href link to see a picture and pass the index of this item to the Action class Wilson tennis ball 5 a href link to see a picture and pass the index of this item to he Action class XYZ tenis shirt 2 a href link to see a picture and pass the index of this item to he Action class I appreciate any suggestion. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can a a href be made to function as a 'submit'
Sure, all you need is a bit of JavaScript that submits your form tag. The 'myForm' form is representative: form name=myForm input type=text name=someField1/ input type=text name=someField2/ /form a href=javascript:submitForm();Click/a And finally, the function: script language=JavaScript function submitForm() { document.myForm.submit(); } /script That should do it. On 2004-Feb-25 10:02, Au-Yeung, Stella H wrote: Hi: Can a a href be made to function as a 'submit' and upon submission, all the formBean properties are remembered in the Action class that handles it. When I try to use just the a href I can't get the formBean properties to be remembered. But I can't change my list of a href as submit buttons because I need to pass arguments on each of the a href. Here's an example of what I try to do on my JSP page: When the user clicks a link to see a picture of an item, this JSP will be replaced by another JSP with the picture. So before I leave this page, I must save the Personal information and the item list in a temporary location so when I return to this page, those values will be repopulated. But my problem is, clicking the a href link will not carry over he formBean properties to the Action class for me to save. 'Submit' will but I can't change those a href to 'submit' because I need to pass the item index (0,1,2 etc.) through each a href to the Action class. Personal information: First Name: Last Name: Mailing Address: List of items in your shopping cart: ABC tennis racket 1 a href link to see a picture and pass the index of this item to the Action class Wilson tennis ball5 a href link to see a picture and pass the index of this item to he Action class XYZ tenis shirt 2 a href link to see a picture and pass the index of this item to he Action class I appreciate any suggestion. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nick Heudecker System Mobile, Inc. Email: [EMAIL PROTECTED] Web: http://www.systemmobile.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can a a href be made to function as a 'submit'
But each of my a href is within a html:iterate indexId=index . tag and it passes the index to the next page base on which item in the list the user clicks. How can I do that with what you suggested? My current a href: a href=app/Order/DisplayPictureRequest.exec?partIdx=%=index% img src=images/icoClick.gif/anbsp; Thanks! -Original Message- From: Nick Heudecker [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 25, 2004 10:45 AM To: Struts Users Mailing List Subject: Re: Can a a href be made to function as a 'submit' Sure, all you need is a bit of JavaScript that submits your form tag. The 'myForm' form is representative: form name=myForm input type=text name=someField1/ input type=text name=someField2/ /form a href=javascript:submitForm();Click/a And finally, the function: script language=JavaScript function submitForm() { document.myForm.submit(); } /script That should do it. On 2004-Feb-25 10:02, Au-Yeung, Stella H wrote: Hi: Can a a href be made to function as a 'submit' and upon submission, all the formBean properties are remembered in the Action class that handles it. When I try to use just the a href I can't get the formBean properties to be remembered. But I can't change my list of a href as submit buttons because I need to pass arguments on each of the a href. Here's an example of what I try to do on my JSP page: When the user clicks a link to see a picture of an item, this JSP will be replaced by another JSP with the picture. So before I leave this page, I must save the Personal information and the item list in a temporary location so when I return to this page, those values will be repopulated. But my problem is, clicking the a href link will not carry over he formBean properties to the Action class for me to save. 'Submit' will but I can't change those a href to 'submit' because I need to pass the item index (0,1,2 etc.) through each a href to the Action class. Personal information: First Name: Last Name: Mailing Address: List of items in your shopping cart: ABC tennis racket 1 a href link to see a picture and pass the index of this item to the Action class Wilson tennis ball5 a href link to see a picture and pass the index of this item to he Action class XYZ tenis shirt 2 a href link to see a picture and pass the index of this item to he Action class I appreciate any suggestion. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nick Heudecker System Mobile, Inc. Email: [EMAIL PROTECTED] Web: http://www.systemmobile.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: Can a a href be made to function as a 'submit'
Assuming I know what you're talking about, this is also pretty easy to address: The form is hidden, with one hidden field. It doesn't have to be hidden, certainly. form name=myForm input type=hidden name=partIdx/ /form The link calls the JavaScript function, passing in the current parameter. a href=javascript:submitForm('%=index%');Click/a The function will set the value of the form field and call submit. script language=JavaScript function submitForm(indexVal) { document.myForm.partIdx.value = indexVal; document.myForm.submit(); } /script On 2004-Feb-25 11:02, Au-Yeung, Stella H wrote: But each of my a href is within a html:iterate indexId=index . tag and it passes the index to the next page base on which item in the list the user clicks. How can I do that with what you suggested? My current a href: a href=app/Order/DisplayPictureRequest.exec?partIdx=%=index% img src=images/icoClick.gif/anbsp; Thanks! -Original Message- From: Nick Heudecker [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 25, 2004 10:45 AM To: Struts Users Mailing List Subject: Re: Can a a href be made to function as a 'submit' Sure, all you need is a bit of JavaScript that submits your form tag. The 'myForm' form is representative: form name=myForm input type=text name=someField1/ input type=text name=someField2/ /form a href=javascript:submitForm();Click/a And finally, the function: script language=JavaScript function submitForm() { document.myForm.submit(); } /script That should do it. On 2004-Feb-25 10:02, Au-Yeung, Stella H wrote: Hi: Can a a href be made to function as a 'submit' and upon submission, all the formBean properties are remembered in the Action class that handles it. When I try to use just the a href I can't get the formBean properties to be remembered. But I can't change my list of a href as submit buttons because I need to pass arguments on each of the a href. Here's an example of what I try to do on my JSP page: When the user clicks a link to see a picture of an item, this JSP will be replaced by another JSP with the picture. So before I leave this page, I must save the Personal information and the item list in a temporary location so when I return to this page, those values will be repopulated. But my problem is, clicking the a href link will not carry over he formBean properties to the Action class for me to save. 'Submit' will but I can't change those a href to 'submit' because I need to pass the item index (0,1,2 etc.) through each a href to the Action class. Personal information: First Name: Last Name: Mailing Address: List of items in your shopping cart: ABC tennis racket 1 a href link to see a picture and pass the index of this item to the Action class Wilson tennis ball 5 a href link to see a picture and pass the index of this item to he Action class XYZ tenis shirt 2 a href link to see a picture and pass the index of this item to he Action class I appreciate any suggestion. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nick Heudecker System Mobile, Inc. Email: [EMAIL PROTECTED] Web: http://www.systemmobile.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] -- Nick Heudecker System Mobile, Inc. Email: [EMAIL PROTECTED] Web: http://www.systemmobile.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can a a href be made to function as a 'submit'
Thanks Nick...I completelu forgot you can 'dynamically' change form fields value such as 'document.myForm.partIdx.value'. What you suggested should work. -Original Message- From: Nick Heudecker [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 25, 2004 12:11 PM To: Struts Users Mailing List Subject: Re: Can a a href be made to function as a 'submit' Assuming I know what you're talking about, this is also pretty easy to address: The form is hidden, with one hidden field. It doesn't have to be hidden, certainly. form name=myForm input type=hidden name=partIdx/ /form The link calls the JavaScript function, passing in the current parameter. a href=javascript:submitForm('%=index%');Click/a The function will set the value of the form field and call submit. script language=JavaScript function submitForm(indexVal) { document.myForm.partIdx.value = indexVal; document.myForm.submit(); } /script On 2004-Feb-25 11:02, Au-Yeung, Stella H wrote: But each of my a href is within a html:iterate indexId=index . tag and it passes the index to the next page base on which item in the list the user clicks. How can I do that with what you suggested? My current a href: a href=app/Order/DisplayPictureRequest.exec?partIdx=%=index% img src=images/icoClick.gif/anbsp; Thanks! -Original Message- From: Nick Heudecker [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 25, 2004 10:45 AM To: Struts Users Mailing List Subject: Re: Can a a href be made to function as a 'submit' Sure, all you need is a bit of JavaScript that submits your form tag. The 'myForm' form is representative: form name=myForm input type=text name=someField1/ input type=text name=someField2/ /form a href=javascript:submitForm();Click/a And finally, the function: script language=JavaScript function submitForm() { document.myForm.submit(); } /script That should do it. On 2004-Feb-25 10:02, Au-Yeung, Stella H wrote: Hi: Can a a href be made to function as a 'submit' and upon submission, all the formBean properties are remembered in the Action class that handles it. When I try to use just the a href I can't get the formBean properties to be remembered. But I can't change my list of a href as submit buttons because I need to pass arguments on each of the a href. Here's an example of what I try to do on my JSP page: When the user clicks a link to see a picture of an item, this JSP will be replaced by another JSP with the picture. So before I leave this page, I must save the Personal information and the item list in a temporary location so when I return to this page, those values will be repopulated. But my problem is, clicking the a href link will not carry over he formBean properties to the Action class for me to save. 'Submit' will but I can't change those a href to 'submit' because I need to pass the item index (0,1,2 etc.) through each a href to the Action class. Personal information: First Name: Last Name: Mailing Address: List of items in your shopping cart: ABC tennis racket 1 a href link to see a picture and pass the index of this item to the Action class Wilson tennis ball 5 a href link to see a picture and pass the index of this item to he Action class XYZ tenis shirt 2 a href link to see a picture and pass the index of this item to he Action class I appreciate any suggestion. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nick Heudecker System Mobile, Inc. Email: [EMAIL PROTECTED] Web: http://www.systemmobile.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] -- Nick Heudecker System Mobile, Inc. Email: [EMAIL PROTECTED] Web: http://www.systemmobile.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]
converting a href with variable target into html:link
I am converting a pure JSP page into Struts, and am having problem converting links which calls a javascript and has dynamically specified target. The particular line is below: a href=javascript:if (confirm('Do you want to delete this event?')) location = 'delete.jsp?e=%= EventId %' class=eventheaderlinkDelete/a My current converted line reads: a href=javascript:if (confirm('Do you want to delete this event?')) location = '/EventDelete.do?e=bean:write name=EventForm property=eventId/' class=eventheaderlink but I cannot find an equivalent using html:link, problem being I cannot add the closing single quote back (or more generally stated, I cannot have constant+variable+constant in the link). My attempt: html:link href=javascript:if (confirm('Do you want to delete this event?')) location = '/EventDelete.do paramId=e paramName=EventForm paramProperty=eventId styleClass=eventheaderlink is missing the last ' and causes error. So is there a way to do this in html:link? And is there a need to convert all a to html:link in the first place? Because I am also having problem converting a href=mailto:%= htmlescape(contactemail) % class=eventemaillink%= htmlescape(evcontactemail) %/a into html:link, since there is no paramId that I can specify, and using paramId always automatically add a ? to the created link. Thanks in advance on any pointers, Ricky Purnomo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: converting a href with variable target into html:link
I like to avoid putting javascript logic in the JSP tag itself (although you can usually do it if you get the syntax right). I usually pull the script out of the tag like this: script function deleteEvent() { if (confirm('Do you want to delete this event?')) { location = '/EventDelete.do?e=' + document.all(eventId).value; } } /script html-el:form name=eventForm html-el:hidden property=eventId value=${requestScope.eventForm.eventId}/ html-el:link href=javascript:deleteEvent(); styleClass=eventheaderlink/ /html-el:form I know that's a bit different to what you are doing but that is how I would do it and your javascript is nice and clear (you can even put it in a separate file). Heya Gosper CSC Australia 212 Northbourne Ave, Braddon ACT 2612 Ph: +61 (0) 2 6246 8155 Fax: +61 (0) 2 62468100 MOB: 0401 611779 This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. Ricky Purnomo [EMAIL PROTECTED] 14/01/2004 02:00 PM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:converting a href with variable target into html:link I am converting a pure JSP page into Struts, and am having problem converting links which calls a javascript and has dynamically specified target. The particular line is below: a href=javascript:if (confirm('Do you want to delete this event?')) location = 'delete.jsp?e=%= EventId %' class=eventheaderlinkDelete/a My current converted line reads: a href=javascript:if (confirm('Do you want to delete this event?')) location = '/EventDelete.do?e=bean:write name=EventForm property=eventId/' class=eventheaderlink but I cannot find an equivalent using html:link, problem being I cannot add the closing single quote back (or more generally stated, I cannot have constant+variable+constant in the link). My attempt: html:link href=javascript:if (confirm('Do you want to delete this event?')) location = '/EventDelete.do paramId=e paramName=EventForm paramProperty=eventId styleClass=eventheaderlink is missing the last ' and causes error. So is there a way to do this in html:link? And is there a need to convert all a to html:link in the first place? Because I am also having problem converting a href=mailto:%= htmlescape(contactemail) % class=eventemaillink%= htmlescape(evcontactemail) %/a into html:link, since there is no paramId that I can specify, and using paramId always automatically add a ? to the created link. Thanks in advance on any pointers, Ricky Purnomo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How do you mimic the 'a href' functionality in Struts?
Hi, I have the following link in my JSP page: td width=130a href=/servlets/blotter/Contact?page=viewcontactlist target=rightframe class=linkboldContact List/a/td I want to mimic the above using Struts JSP tags(I don't want to use a SUBMIT button). However, I want to call my ActionForm class instead of the servlet and I would like to set the value of the param 'page' to 'viewcontactlist' for my ActionForm class so that my Action class can use it. Is it possible to do this? Here is my ActionForm implementation: import javax.servlet.http.HttpServletRequest; import org.apache.strus.action.*; public final class ContactForm extends ActionForm { // page parameter from the CDS menu private String pageName =null; public String getPageName(){ return (this.pageName); } public void setPageName(String pageName){ this.pageName = pageName; } } -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do you mimic the 'a href' functionality in Struts?
-Original Message- From: Mehran Zonouzi [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 8:24 AM To: Struts Users Mailing List Subject: How do you mimic the 'a href' functionality in Struts? td width=130a href=/servlets/blotter/Contact?page=viewcontactlist target=rightframe class=linkboldContact List/a/td I want to mimic the above using Struts JSP tags(I don't want to use a SUBMIT button). However, I want to call my ActionForm class instead of the servlet and I would like to set the value of the param 'page' to 'viewcontactlist' for my ActionForm class so that my Action class can use it. Is it possible to do this? Yes. Your href attribute can point to a JavaScript function that sets some hidden form variables then submits the form. It would look something like this: script type=text/javascript function submitFunctionForYou(lType) { document.yerForm.elements[page].value = lType; } /script td html:form action=/yerAction html:hidden property=page / /html:form a href=submitFunctionForYou('viewcontactlist'); return true;Contact List/a /td -= J - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do you mimic the 'a href' functionality in Struts?
In general, you use the html:link tag http://jakarta.apache.org/struts/userGuide/struts-html.html#link For the destination of the link, it takes one of four attributes: forward, action, href, or page. The mechanism for specifying a single parameter for the link uses these attributes: paramId, paramName, paramProperty, paramScope The value of paramId is the request parameter name. In your HTML sample, then, this would be page, although in your ActionForm, this would probably be pageName. (You probably want those to be consistent with each other.) You can specify the value for the parameter with the appropriate combination of paramName, paramProperty, and paramScope, with semantics analogous to name, property, and scope in the various bean tags. If you need to specify multiple parameters, this is done with a map whose keys are parameter names and whose values are the values to be put in the URL. See the docs for more details. However, I'm guessing from your example link that you'd pass the same parameter in the link every time -- that is, you'd always want the text Contact List linked to the same URL. In this case, the better Struts way to do it would be to define different action mappings for each of the various parameters you would pass. This leaves you a lot of future flexibility about how the functionality is provided. If necessary, you could write a separate Struts Action class for each mapping, or you could use one action for several mappings and use an action mapping parameter to dispatch execution to a parameter-specific method inside the action. Hope this helps. Joe At 14:23 +0100 9/9/03, Mehran Zonouzi wrote: Hi, I have the following link in my JSP page: td width=130a href=/servlets/blotter/Contact?page=viewcontactlist target=rightframe class=linkboldContact List/a/td I want to mimic the above using Struts JSP tags(I don't want to use a SUBMIT button). However, I want to call my ActionForm class instead of the servlet and I would like to set the value of the param 'page' to 'viewcontactlist' for my ActionForm class so that my Action class can use it. Is it possible to do this? Here is my ActionForm implementation: import javax.servlet.http.HttpServletRequest; import org.apache.strus.action.*; public final class ContactForm extends ActionForm { // page parameter from the CDS menu private String pageName =null; public String getPageName(){ return (this.pageName); } public void setPageName(String pageName){ this.pageName = pageName; } } -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com If nature worked that way, the universe would crash all the time. --Jaron Lanier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do you mimic the 'a href' functionality in Struts?
Yes I am going to pass the same param to the link every time. This is what I have replaced the link with. I am not too sure if I should be using the href property to call my ActionForm class. html:link href=ContactForm paramId=page paramName=viewcontactlist Joe Germuska [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject: Re: How do you mimic the 'a href' functionality in Struts? 09/09/03 14:47 Please respond to Struts Users Mailing List In general, you use the html:link tag http://jakarta.apache.org/struts/userGuide/struts-html.html#link For the destination of the link, it takes one of four attributes: forward, action, href, or page. The mechanism for specifying a single parameter for the link uses these attributes: paramId, paramName, paramProperty, paramScope The value of paramId is the request parameter name. In your HTML sample, then, this would be page, although in your ActionForm, this would probably be pageName. (You probably want those to be consistent with each other.) You can specify the value for the parameter with the appropriate combination of paramName, paramProperty, and paramScope, with semantics analogous to name, property, and scope in the various bean tags. If you need to specify multiple parameters, this is done with a map whose keys are parameter names and whose values are the values to be put in the URL. See the docs for more details. However, I'm guessing from your example link that you'd pass the same parameter in the link every time -- that is, you'd always want the text Contact List linked to the same URL. In this case, the better Struts way to do it would be to define different action mappings for each of the various parameters you would pass. This leaves you a lot of future flexibility about how the functionality is provided. If necessary, you could write a separate Struts Action class for each mapping, or you could use one action for several mappings and use an action mapping parameter to dispatch execution to a parameter-specific method inside the action. Hope this helps. Joe At 14:23 +0100 9/9/03, Mehran Zonouzi wrote: Hi, I have the following link in my JSP page: td width=130a href=/servlets/blotter/Contact?page=viewcontactlist target=rightframe class=linkboldContact List/a/td I want to mimic the above using Struts JSP tags(I don't want to use a SUBMIT button). However, I want to call my ActionForm class instead of the servlet and I would like to set the value of the param 'page' to 'viewcontactlist' for my ActionForm class so that my Action class can use it. Is it possible to do this? Here is my ActionForm implementation: import javax.servlet.http.HttpServletRequest; import org.apache.strus.action.*; public final class ContactForm extends ActionForm { // page parameter from the CDS menu private String pageName =null; public String getPageName(){ } public void setPageName(String pageName){ } } -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com If nature worked that way, the universe would crash all the time. --Jaron Lanier - To unsubscribe, e
Re: How do you mimic the 'a href' functionality in Struts?
At 15:03 +0100 9/9/03, Mehran Zonouzi wrote: Yes I am going to pass the same param to the link every time. This is what I have replaced the link with. I am not too sure if I should be using the href property to call my ActionForm class. html:link href=ContactForm paramId=page paramName=viewcontactlist At first encounter, the distinctions between the various link destination attributes can be a little confusing -- but you probably don't want to use href in this case. If you have a specific action mapping called /ContactForm then you should use 'action=/ContactForm' You would generally only want to use href when you were linking outside of your web application -- the other three provide dynamic URL rewriting to prepend the application context path so that you can deploy the same web app under different context paths without having to change your JSPs... (Other tags like html:img provide similar rewriting...) The below is copied from the docs for this tag: The base URL for this hyperlink is calculated based on which of the following attributes you specify (you must specify exactly one of them): * forward - Use the value of this attribute as the name of a global ActionForward to be looked up, and use the application-relative or context-relative URI found there. * action - Use the value of this attribute as the name of a Action to be looked up, and use the application-relative or context-relative URI found there. * href - Use the value of this attribute unchanged. * page - Use the value of this attribute as a application-relative URI, and generate a server-relative URI by including the context path and application prefix. Joe -- -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com If nature worked that way, the universe would crash all the time. --Jaron Lanier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do you mimic the 'a href' functionality in Struts?
Does the name I use for action i.e ContactForm have to tie in with what I use in the struts-config.xml file? html:link action=/ContactForm paramId=page paramName=viewcontactlist paramScope=request i.e. Do I need to put ContactForm instead of 'contacts' for path... action path=/contacts type=com.db.gcp.lemweb.blotter.servlets.ContactAction name=contactForm input=/viewcontactlist.jsp scope=request /action Joe Germuska [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject: Re: How do you mimic the 'a href' functionality in Struts? 09/09/03 17:53 Please respond to Struts Users Mailing List At 15:03 +0100 9/9/03, Mehran Zonouzi wrote: Yes I am going to pass the same param to the link every time. This is what I have replaced the link with. I am not too sure if I should be using the href property to call my ActionForm class. html:link href=ContactForm paramId=page paramName=viewcontactlist At first encounter, the distinctions between the various link destination attributes can be a little confusing -- but you probably don't want to use href in this case. If you have a specific action mapping called /ContactForm then you should use 'action=/ContactForm' You would generally only want to use href when you were linking outside of your web application -- the other three provide dynamic URL rewriting to prepend the application context path so that you can deploy the same web app under different context paths without having to change your JSPs... (Other tags like html:img provide similar rewriting...) The below is copied from the docs for this tag: The base URL for this hyperlink is calculated based on which of the following attributes you specify (you must specify exactly one of them): * forward - Use the value of this attribute as the name of a global ActionForward to be looked up, and use the application-relative or context-relative URI found there. * action - Use the value of this attribute as the name of a Action to be looked up, and use the application-relative or context-relative URI found there. * href - Use the value of this attribute unchanged. * page - Use the value of this attribute as a application-relative URI, and generate a server-relative URI by including the context path and application prefix. Joe -- -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com If nature worked that way, the universe would crash all the time. --Jaron Lanier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do you mimic the 'a href' functionality in Struts?
i.e. Do I need to put ContactForm instead of 'contacts' for path... action path=/contacts type=com.db.gcp.lemweb.blotter.servlets.ContactAction name=contactForm input=/viewcontactlist.jsp scope=request /action No, contacts is the URL that the browser asks for to invoke your ContactAction class. ContactForm is the FormBean (explicitly defined elsewhere in the struts-config.xml file) that will be passed to the ContactAction class. Therefore, ContactForm should be the form bean used by the form in viewcontactlist.jsp. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do you mimic the 'a href' functionality in Struts?
The action attribute of the html:link tag and the path attribute of the action element should be identical. Note that the value of the paramName attribute (viewcontactlist in your example) is not a string literal, but rather the name of a bean in some scope (page, request, session, or application) which will be looked up and converted to a string as the value of the parameter. In your case, since you specify paramScope=request, the tag will specifically call request.getAttribute(viewcontactlist) to get the value. Joe At 18:02 +0100 9/9/03, Mehran Zonouzi wrote: Does the name I use for action i.e ContactForm have to tie in with what I use in the struts-config.xml file? html:link action=/ContactForm paramId=page paramName=viewcontactlist paramScope=request i.e. Do I need to put ContactForm instead of 'contacts' for path... action path=/contacts type=com.db.gcp.lemweb.blotter.servlets.ContactAction name=contactForm input=/viewcontactlist.jsp scope=request /action -- -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com If nature worked that way, the universe would crash all the time. --Jaron Lanier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dinamically add href into html:link
Thanks, I used html-el and it works. what is the better to use, use c:url or html-el:link? Or it is equivalent here? And one more queestion: I have object with application persistency (over all sessions), and for session I call some method to set some parameter and get another object (array list) and maybe store it in session. Now I do: jsp:useBean id=a class=cz.chalu.modules.blabla.Class scope=application / and, now provisory, this as scriptlet: % a.setRequest(request); User user = (User)session.getAttribute(user); if(user != null){ a.setUser(user); } getServletContext().setAttribute(b, a.getSomething().toArray()); % next, I call some c:forEach ... cykle for b object. How I can do it correctly in struts / jstl? Thanks, Jiri Mark Lowe wrote: The ideal way would be something like this. c:url url=${menuItem.link} c:out var=${menuItem.name}/ /c:url Cheers Mark On Sunday, August 31, 2003, at 04:27 PM, Yann Cébron wrote: how I can do something as this: html:link action=${menuItem.link} c:out value=${menuItem.name} / ? Use the EL-tags (look in the contrib/struts-el directory of the Struts 1.1 distribution), e.g. html-el:link action=${menuItem.link} .. .. /html-el:link HTH, Yann - 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: dinamically add href into html:link
opps... c:url value=${menuItem.link} c:out value=${menuItem.name} / /c:url is better On Sunday, August 31, 2003, at 05:02 PM, Mark Lowe wrote: The ideal way would be something like this. c:url url=${menuItem.link} c:out var=${menuItem.name}/ /c:url Cheers Mark On Sunday, August 31, 2003, at 04:27 PM, Yann Cébron wrote: how I can do something as this: html:link action=${menuItem.link} c:out value=${menuItem.name} / ? Use the EL-tags (look in the contrib/struts-el directory of the Struts 1.1 distribution), e.g. html-el:link action=${menuItem.link} .. .. /html-el:link HTH, Yann - 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: dinamically add href into html:link
The ideal way would be something like this. c:url url=${menuItem.link} c:out var=${menuItem.name}/ /c:url Cheers Mark On Sunday, August 31, 2003, at 04:27 PM, Yann Cébron wrote: how I can do something as this: html:link action=${menuItem.link} c:out value=${menuItem.name} / ? Use the EL-tags (look in the contrib/struts-el directory of the Struts 1.1 distribution), e.g. html-el:link action=${menuItem.link} .. .. /html-el:link HTH, Yann - 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]
dinamically add href into html:link
Hallo, how I can do something as this: html:link action=${menuItem.link} c:out value=${menuItem.name} / ? I tried page (in manual I read that it canbe created dynamicaly, but it does not), action, href... it is still generated as a href=/apl/${menuItem.doHome/a instead of /apl/Index.do I know I can do a href=c:out value=${menuItem.link} but it does not add application prefix :( Thanks, Jiri - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dinamically add href into html:link
Are you able to use JSTL? I use JSTL for that. Jiri Chaloupka wrote: Hallo, how I can do something as this: html:link action=${menuItem.link} c:out value=${menuItem.name} / ? I tried page (in manual I read that it canbe created dynamicaly, but it does not), action, href... it is still generated as a href=/apl/${menuItem.doHome/a instead of /apl/Index.do I know I can do a href=c:out value=${menuItem.link} but it does not add application prefix :( Thanks, Jiri -- Vic Cekvenich, Struts Instructor, 1-800-917-JAVA Advanced a href =baseBeans.comStruts Training/a, mentoring and project recovery in North East. Struts conversion and a href =baseBeans.com fixed bid development/a. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dinamically add href into html:link
how I can do something as this: html:link action=${menuItem.link} c:out value=${menuItem.name} / ? Use the EL-tags (look in the contrib/struts-el directory of the Struts 1.1 distribution), e.g. html-el:link action=${menuItem.link} .. .. /html-el:link HTH, Yann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dinamically add href into html:link
c:url is a standard tag from JSTL, so I think it's better to follow standards Maybe html:link will be deprecated in a near future. -Mensaje original- De: Jiri Chaloupka [mailto:[EMAIL PROTECTED] Enviado el: domingo, 31 de agosto de 2003 18:36 Para: Struts Users Mailing List Asunto: Re: dinamically add href into html:link Thanks, I used html-el and it works. what is the better to use, use c:url or html-el:link? Or it is equivalent here? And one more queestion: I have object with application persistency (over all sessions), and for session I call some method to set some parameter and get another object (array list) and maybe store it in session. Now I do: jsp:useBean id=a class=cz.chalu.modules.blabla.Class scope=application / and, now provisory, this as scriptlet: % a.setRequest(request); User user = (User)session.getAttribute(user); if(user != null){ a.setUser(user); } getServletContext().setAttribute(b, a.getSomething().toArray()); % next, I call some c:forEach ... cykle for b object. How I can do it correctly in struts / jstl? Thanks, Jiri Mark Lowe wrote: The ideal way would be something like this. c:url url=${menuItem.link} c:out var=${menuItem.name}/ /c:url Cheers Mark On Sunday, August 31, 2003, at 04:27 PM, Yann Cébron wrote: how I can do something as this: html:link action=${menuItem.link} c:out value=${menuItem.name} / ? Use the EL-tags (look in the contrib/struts-el directory of the Struts 1.1 distribution), e.g. html-el:link action=${menuItem.link} .. .. /html-el:link HTH, Yann - 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: dinamically add href into html:link
If you've the choice use JSTL.. If you're using the expression language then use that. I like using the standard struts tags but that because there's no el. and after reading the faces stuff, i'm sold on using jstl. Although I'm not JSTL's biggest fan it does have a certain elegance of its own. I'm gradually being won over. The fmt tags are really nice. Cheers Mark On Sunday, August 31, 2003, at 07:53 PM, Carlos Sánchez wrote: c:url is a standard tag from JSTL, so I think it's better to follow standards Maybe html:link will be deprecated in a near future. -Mensaje original- De: Jiri Chaloupka [mailto:[EMAIL PROTECTED] Enviado el: domingo, 31 de agosto de 2003 18:36 Para: Struts Users Mailing List Asunto: Re: dinamically add href into html:link Thanks, I used html-el and it works. what is the better to use, use c:url or html-el:link? Or it is equivalent here? And one more queestion: I have object with application persistency (over all sessions), and for session I call some method to set some parameter and get another object (array list) and maybe store it in session. Now I do: jsp:useBean id=a class=cz.chalu.modules.blabla.Class scope=application / and, now provisory, this as scriptlet: % a.setRequest(request); User user = (User)session.getAttribute(user); if(user != null){ a.setUser(user); } getServletContext().setAttribute(b, a.getSomething().toArray()); % next, I call some c:forEach ... cykle for b object. How I can do it correctly in struts / jstl? Thanks, Jiri Mark Lowe wrote: The ideal way would be something like this. c:url url=${menuItem.link} c:out var=${menuItem.name}/ /c:url Cheers Mark On Sunday, August 31, 2003, at 04:27 PM, Yann Cébron wrote: how I can do something as this: html:link action=${menuItem.link} c:out value=${menuItem.name} / ? Use the EL-tags (look in the contrib/struts-el directory of the Struts 1.1 distribution), e.g. html-el:link action=${menuItem.link} .. .. /html-el:link HTH, Yann - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dinamically add href into html:link
OK, thanks for your view. Maybe it will be better to rewrite it, until there is not much code... Jiri Mark Lowe wrote: If you've the choice use JSTL.. If you're using the expression language then use that. I like using the standard struts tags but that because there's no el. and after reading the faces stuff, i'm sold on using jstl. Although I'm not JSTL's biggest fan it does have a certain elegance of its own. I'm gradually being won over. The fmt tags are really nice. Cheers Mark On Sunday, August 31, 2003, at 07:53 PM, Carlos Sánchez wrote: c:url is a standard tag from JSTL, so I think it's better to follow standards Maybe html:link will be deprecated in a near future. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validator using A href instead of html:submit
Hi, I'm using trying to use ValidatorActionForm and tile, but the submit button is outside of the form on a different JSP, therefore, I need to submit my form indirectly using a link and javascript (see code below). Neither the client-side javascript nor the server-side validation get called. But if I hardcode a submit button WITHIN the form, the javascript will get called. So, does this mean that validator will not work with document.forms[0].submit(); ? Is there a workaround this? I'm sure there are someone out there doing similar thing. Thanks! JP My action form: html:form action=/enterAppInfo1 onsubmit=validateEnterAppInfo1(this); html:errors /nbsp; html:select property=primAddrState onchange='runSelectOnChange();' html:optionsCollection label=label value=value name=... property=... / /html:select /html:form html:javascript formName=enterAppInfo1 / !-- Assuming one form per page, in the end of doSomethingBeforeSubmit(...), I'm calling: -- !-- document.forms[0].submit(); -- A href=javascript:doSomethingBeforeSubmit(...);/ IMG name=... src=... onmouseover=javascript:submitChoiceOnMouseOver(...);return true; onmouseout=javascript:submitChoiceOnMouseOut(...);return true; alt=. border=0/A My validation.xml: formset form name=enterAppInfo1 field property=primAddrState depends=required msg name=required key=errors.state.required / /field /form /formset ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator using A href instead of html:submit
should it be a validatorForm? sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Hi, I'm using trying to use ValidatorActionForm and tile, but the submit button is outside of the form on a different JSP, therefore, I need to submit my form indirectly using a link and javascript (see code below). Neither the client-side javascript nor the server-side validation get called. But if I hardcode a submit button WITHIN the form, the javascript will get called. So, does this mean that validator will not work with document.forms[0].submit(); ? Is there a workaround this? I'm sure there are someone out there doing similar thing. Thanks! JP My action form: html:form action=/enterAppInfo1 onsubmit=validateEnterAppInfo1(this); html:errors /nbsp; html:select property=primAddrState onchange='runSelectOnChange();' html:optionsCollection label=label value=value name=... property=... / /html:select /html:form html:javascript formName=enterAppInfo1 / !-- Assuming one form per page, in the end of doSomethingBeforeSubmit(...), I'm calling: -- !-- document.forms[0].submit(); -- A href=javascript:doSomethingBeforeSubmit(...);/ IMG name=... src=... onmouseover=javascript:submitChoiceOnMouseOver(...);return true; onmouseout=javascript:submitChoiceOnMouseOut(...);return true; alt=. border=0/A My validation.xml: formset form name=enterAppInfo1 field property=primAddrState depends=required msg name=required key=errors.state.required / /field /form /formset ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validator using A href instead of html:submit
What is the javascript created by the custom tag when looking at the source? I think you shouldn't need to call: validateEnterAppInfo1(this) but what happens if you do? maybe there is more than one form? Is the form being submitted and the data is in the form? sorry I can't help any more than that. sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Sandeep, No, because I'm using the same bean across different screen, so ValidatorActionForm suits me better, as it validates based on the action instead of the form. JP -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 10:48 AM To: Struts Users Mailing List Subject: Re: Validator using A href instead of html:submit should it be a validatorForm? sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Hi, I'm using trying to use ValidatorActionForm and tile, but the submit button is outside of the form on a different JSP, therefore, I need to submit my form indirectly using a link and javascript (see code below). Neither the client-side javascript nor the server-side validation get called. But if I hardcode a submit button WITHIN the form, the javascript will get called. So, does this mean that validator will not work with document.forms[0].submit(); ? Is there a workaround this? I'm sure there are someone out there doing similar thing. Thanks! JP My action form: html:form action=/enterAppInfo1 onsubmit=validateEnterAppInfo1(this); html:errors /nbsp; html:select property=primAddrState onchange='runSelectOnChange();' html:optionsCollection label=label value=value name=... property=... / /html:select /html:form html:javascript formName=enterAppInfo1 / !-- Assuming one form per page, in the end of doSomethingBeforeSubmit(...), I'm calling: -- !-- document.forms[0].submit(); -- A href=javascript:doSomethingBeforeSubmit(...);/ IMG name=... src=... onmouseover=javascript:submitChoiceOnMouseOver(...);return true; onmouseout=javascript:submitChoiceOnMouseOut(...);return true; alt=. border=0/A My validation.xml: formset form name=enterAppInfo1 field property=primAddrState depends=required msg name=required key=errors.state.required / /field /form /formset ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validator using A href instead of html:submit
Sandeep, The validateEnterAppInfo1(form) method gets called with the submit button hardcode w/i the html:form. If I remove the validateEnterAppInfo1(this) call, no javascript validation will take place, while the server-side validation still works. There is always going to be only one form per page, so using document.forms[0].submit() should be ok. When this form pass validation the data is submitted. This is part of the generated javascripts: script type=text/javascript language=Javascript1.1 !-- Begin var bCancel = false; function validateEnterAppInfo1(form) { if (bCancel) return true; else return validateRequired(form); } function required () { this.aa = new Array(primAddrState, Please select your state of residence to continue., new Function (varName, return this[varName];)); } function validateRequired(form) { var isValid = true; var focusField = null; var i = 0; var fields = new Array(); oRequired = new required(); for (x in oRequired) { var field = form[oRequired[x][0]]; if (field.type == 'text' || field.type == 'textarea' || field.type == 'file' || field.type == 'select-one' || field.type == 'radio' || field.type == 'password') { var value = ''; // get field's value if (field.type == select-one) { var si = field.selectedIndex; if (si = 0) { value = field.options[si].value; } } else { value = field.value; } if (value == '') { if (i == 0) { focusField = field; } fields[i++] = oRequired[x][1]; isValid = false; } } } if (fields.length 0) { focusField.focus(); alert(fields.join('\n')); } return isValid; } function required () { this.aa = new Array(primAddrState, Please select your state of residence to continue., new Function (varName, return this[varName];)); } -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 11:29 AM To: Struts Users Mailing List Subject: RE: Validator using A href instead of html:submit What is the javascript created by the custom tag when looking at the source? I think you shouldn't need to call: validateEnterAppInfo1(this) but what happens if you do? maybe there is more than one form? Is the form being submitted and the data is in the form? sorry I can't help any more than that. sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Sandeep, No, because I'm using the same bean across different screen, so ValidatorActionForm suits me better, as it validates based on the action instead of the form. JP -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 10:48 AM To: Struts Users Mailing List Subject: Re: Validator using A href instead of html:submit should it be a validatorForm? sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Hi, I'm using trying to use ValidatorActionForm and tile, but the submit button is outside of the form on a different JSP, therefore, I need to submit my form indirectly using a link and javascript (see code below). Neither the client-side javascript nor the server-side validation get called. But if I hardcode a submit button WITHIN the form, the javascript will get called. So, does this mean that validator will not work with document.forms[0].submit(); ? Is there a workaround this? I'm sure there are someone out there doing similar thing. Thanks! JP My action form: html:form action=/enterAppInfo1 onsubmit=validateEnterAppInfo1(this); html:errors /nbsp; html:select property=primAddrState onchange='runSelectOnChange();' html:optionsCollection label=label value=value name=... property=... / /html:select
RE: Validator using A href instead of html:submit
It seems to me like it should work. I have used submit() on forms and it will go to the action element of the form tag. So this is just html specs here. Don't know why the validation is not being called. There should be some onSubmit= somewhere in the form tag probably... sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Sandeep, The validateEnterAppInfo1(form) method gets called with the submit button hardcode w/i the html:form. If I remove the validateEnterAppInfo1(this) call, no javascript validation will take place, while the server-side validation still works. There is always going to be only one form per page, so using document.forms[0].submit() should be ok. When this form pass validation the data is submitted. This is part of the generated javascripts: script type=text/javascript language=Javascript1.1 !-- Begin var bCancel = false; function validateEnterAppInfo1(form) { if (bCancel) return true; else return validateRequired(form); } function required () { this.aa = new Array(primAddrState, Please select your state of residence to continue., new Function (varName, return this[varName];)); } function validateRequired(form) { var isValid = true; var focusField = null; var i = 0; var fields = new Array(); oRequired = new required(); for (x in oRequired) { var field = form[oRequired[x][0]]; if (field.type == 'text' || field.type == 'textarea' || field.type == 'file' || field.type == 'select-one' || field.type == 'radio' || field.type == 'password') { var value = ''; // get field's value if (field.type == select-one) { var si = field.selectedIndex; if (si = 0) { value = field.options[si].value; } } else { value = field.value; } if (value == '') { if (i == 0) { focusField = field; } fields[i++] = oRequired[x][1]; isValid = false; } } } if (fields.length 0) { focusField.focus(); alert(fields.join('\n')); } return isValid; } function required () { this.aa = new Array(primAddrState, Please select your state of residence to continue., new Function (varName, return this[varName];)); } -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 11:29 AM To: Struts Users Mailing List Subject: RE: Validator using A href instead of html:submit What is the javascript created by the custom tag when looking at the source? I think you shouldn't need to call: validateEnterAppInfo1(this) but what happens if you do? maybe there is more than one form? Is the form being submitted and the data is in the form? sorry I can't help any more than that. sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Sandeep, No, because I'm using the same bean across different screen, so ValidatorActionForm suits me better, as it validates based on the action instead of the form. JP -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 10:48 AM To: Struts Users Mailing List Subject: Re: Validator using A href instead of html:submit should it be a validatorForm? sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Hi, I'm using trying to use ValidatorActionForm and tile, but the submit button is outside of the form on a different JSP, therefore, I need to submit my form indirectly using a link and javascript (see code below). Neither the client-side javascript nor the server-side validation get called. But if I hardcode a submit button WITHIN the form, the javascript will get called. So, does this mean that validator will not work with document.forms[0
html:link/ w/out a href??
I have a form with 2 buttons. I know I can handle this ok using the dispatch property. But, what I'd rather do (so I don't have to put ugly query strings in my links) is use javascript. What I'm wondering is, if there's a way to get action - link resolution that the html:link/ tag gives me without the a href= code file=linker.jsp html head script type=text/javascript function clicked(){ var link = html:link value=action/to/do/; // this won't work since the value in link is actually a href=action_to_do.jsp window.open( link ); Thanks, Ben Anderson _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:link/ w/out a href??
Ben Anderson rta: I have a form with 2 buttons. I know I can handle this ok using the dispatch property. But, what I'd rather do (so I don't have to put ugly query strings in my links) is use javascript. What I'm wondering is, if there's a way to get action - link resolution that the html:link/ tag gives me without the a href= html:rewrite? Tib - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:link/ w/out a href??
could this do it...? script function clicked(path) { window.open(path,My Popup,); } /script a href=javascript:clicked('html:rewrite page=/yourAction.do /') On Wednesday, Jun 18, 2003, at 14:52 Europe/London, Ben Anderson wrote: I have a form with 2 buttons. I know I can handle this ok using the dispatch property. But, what I'd rather do (so I don't have to put ugly query strings in my links) is use javascript. What I'm wondering is, if there's a way to get action - link resolution that the html:link/ tag gives me without the a href= code file=linker.jsp html head script type=text/javascript function clicked(){ var link = html:link value=action/to/do/; // this won't work since the value in link is actually a href=action_to_do.jsp window.open( link ); Thanks, Ben Anderson _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:link/ w/out a href??
Why not give the buttons a name and submit to a process action. This action checks the name and forwards to the appropriate place.. sandeep --- Ben Anderson [EMAIL PROTECTED] wrote: I have a form with 2 buttons. I know I can handle this ok using the dispatch property. But, what I'd rather do (so I don't have to put ugly query strings in my links) is use javascript. What I'm wondering is, if there's a way to get action - link resolution that the html:link/ tag gives me without the a href= code file=linker.jsp html head script type=text/javascript function clicked(){ var link = html:link value=action/to/do/; // this won't work since the value in link is actually a href=action_to_do.jsp window.open( link ); Thanks, Ben Anderson _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Tiles Beginner Question] Href Tile Definitions
I think you don't want to create an action to handle the tiles reference right? If not, then you can simply create a global action that forwards to display say.. action path=/home scope=request type=org.apache.struts.actions.ForwardAction validate=false /action --- Pat Quinn [EMAIL PROTECTED] wrote: I've successfully got tiles up and running... I do understand how i can use a tile definition as a struts forward for my actions but i'm looking to redirect to a tile definition using a href link. E.g. I have the following tile definition: definition name=my.home extends=default put name=title value=MY PAGE TITLE HERE/ put name=body-content value=home-body.jsp/ /definition I have tried the following but it doesn't work (i.e. passing the tile id as a parameter to the ForwardAction): action path=/home parameter=my.home scope=request type=org.apache.struts.actions.ForwardAction validate=false /action I guess what i'm really asking is there a predefined Action which will take my tile Id and forward to this view Its not that i'm lazy as i could write one if i need too but this would mean that i have to create a global forward for any tiles i want to access using a href and then pass the global id to a temporary action in order to view my definition which sounds like a very round about way to achieve this. Any ideas guys?? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Tiles Beginner Question] Href Tile Definitions
sorry I accidently hit tab on the last reply and it sent the email somehow (some weird combination of keystrokes). What I wanted to finish was the action... action path=/home scope=request type=com.xxx.xxx.FowardAction validate=false forward name=display path=my.home/ /action this probably doesn't answer your question the way you want is my guess. you can always call this from another action forward name=home path=/Home.do/ sandeep --- Pat Quinn [EMAIL PROTECTED] wrote: I've successfully got tiles up and running... I do understand how i can use a tile definition as a struts forward for my actions but i'm looking to redirect to a tile definition using a href link. E.g. I have the following tile definition: definition name=my.home extends=default put name=title value=MY PAGE TITLE HERE/ put name=body-content value=home-body.jsp/ /definition I have tried the following but it doesn't work (i.e. passing the tile id as a parameter to the ForwardAction): action path=/home parameter=my.home scope=request type=org.apache.struts.actions.ForwardAction validate=false /action I guess what i'm really asking is there a predefined Action which will take my tile Id and forward to this view Its not that i'm lazy as i could write one if i need too but this would mean that i have to create a global forward for any tiles i want to access using a href and then pass the global id to a temporary action in order to view my definition which sounds like a very round about way to achieve this. Any ideas guys?? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Tiles Beginner Question] Href Tile Definitions
Here is how you should do it: global-forward action-forward name=yourForwardLink path=/yourForwardAction / /global-forward ... action-mappings .. action-mapping name=/yourForwardAction ... Forward=yourTileDefinition / /action-mappings Your.jsp html:link forward=yourForwardLink / -Original Message- From: Pat Quinn [mailto:[EMAIL PROTECTED] Sent: Sunday, June 08, 2003 5:07 PM To: [EMAIL PROTECTED] Subject: [Tiles Beginner Question] Href Tile Definitions I've successfully got tiles up and running... I do understand how i can use a tile definition as a struts forward for my actions but i'm looking to redirect to a tile definition using a href link. E.g. I have the following tile definition: definition name=my.home extends=default put name=title value=MY PAGE TITLE HERE/ put name=body-content value=home-body.jsp/ /definition I have tried the following but it doesn't work (i.e. passing the tile id as a parameter to the ForwardAction): action path=/home parameter=my.home scope=request type=org.apache.struts.actions.ForwardAction validate=false /action I guess what i'm really asking is there a predefined Action which will take my tile Id and forward to this view Its not that i'm lazy as i could write one if i need too but this would mean that i have to create a global forward for any tiles i want to access using a href and then pass the global id to a temporary action in order to view my definition which sounds like a very round about way to achieve this. Any ideas guys?? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and any attachments are for the intended recipient(s) only and may contain privileged, confidential and/or proprietary information about Downey Savings or its customers, which Downey Savings does not intend to disclose to the public. If you received this message by mistake, please notify the sender by reply e-mail and delete the message and attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Tiles Beginner Question] Href Tile Definitions
I've successfully got tiles up and running... I do understand how i can use a tile definition as a struts forward for my actions but i'm looking to redirect to a tile definition using a href link. E.g. I have the following tile definition: definition name=my.home extends=default put name=title value=MY PAGE TITLE HERE/ put name=body-content value=home-body.jsp/ /definition I have tried the following but it doesn't work (i.e. passing the tile id as a parameter to the ForwardAction): action path=/home parameter=my.home scope=request type=org.apache.struts.actions.ForwardAction validate=false /action I guess what i'm really asking is there a predefined Action which will take my tile Id and forward to this view Its not that i'm lazy as i could write one if i need too but this would mean that i have to create a global forward for any tiles i want to access using a href and then pass the global id to a temporary action in order to view my definition which sounds like a very round about way to achieve this. Any ideas guys?? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html link href, forward an action attribute
Can someone explain me the great difference beetween action, href and forward attribute with the html link tag. supposing that there is an action that corresponds to the forward attribute Meissa L'integrite de ce message n'etant pas assuree sur internet, Natexis Banques Populaires ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur. The integrity of this message cannot be guaranteed on the Internet. Natexis Banques Populaires can not therefore be considered responsible for the contents.Any unauthorized use or dissemination is prohibited. If you are not the intended recipient of this message, then please delete it and notify the sender.
Re: html link href, forward an action attribute
Someone already has: http://jakarta.apache.org/struts/userGuide/struts-html.html#link -Kevin --- [EMAIL PROTECTED] wrote: Can someone explain me the great difference beetween action, href and forward attribute with the html link tag. supposing that there is an action that corresponds to the forward attribute Meissa L'integrite de ce message n'etant pas assuree sur internet, Natexis Banques Populaires ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur. The integrity of this message cannot be guaranteed on the Internet. Natexis Banques Populaires can not therefore be considered responsible for the contents.Any unauthorized use or dissemination is prohibited. If you are not the intended recipient of this message, then please delete it and notify the sender. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to put a bean:write in a href=
Hi all, Maybe this is a simple question, but I'm stuck with this: How can I set a href in a html:link tag with a string concatenated with a bean:write...? I mean, I want to do something like this: html:link href=getorg.do?id=bean:write name=orglist property=id/bean:write name=orglist property=id//html:link Of course, this doesn't work. I want href to have the string getorg.do?id= concatenated with the output from bean:write name=orglist property=id/ I suppose this must be done with a scriptlet. By the way, the orglist bean comes from a logic:iterate over a vector of Beans (named orglistview). Anyone? Thanks, Antonio Santos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to put a bean:write in a href=
2 possibilities without using scriplets: 1) Struts-EL: html-el:link href=/getorg.do?id=${orglist.id}/ 2) JSTL: c:url value=/getorg.do c:param name=id value=${orglist.id}/ /c:url -Tim -Original Message- From: António Santos [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 12:54 PM To: [EMAIL PROTECTED] Subject: how to put a bean:write in a href= Hi all, Maybe this is a simple question, but I'm stuck with this: How can I set a href in a html:link tag with a string concatenated with a bean:write...? I mean, I want to do something like this: html:link href=getorg.do?id=bean:write name=orglist property=id/bean:write name=orglist property=id//html:link Of course, this doesn't work. I want href to have the string getorg.do?id= concatenated with the output from bean:write name=orglist property=id/ I suppose this must be done with a scriptlet. By the way, the orglist bean comes from a logic:iterate over a vector of Beans (named orglistview). Anyone? Thanks, Antonio Santos - 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 put a bean:write in a href=
Do this html:link href=getorg.do paramId=id paramName=orglist paramProperty=id -Original Message- From: António Santos [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 11:54 AM To: [EMAIL PROTECTED] Subject: how to put a bean:write in a href= Hi all, Maybe this is a simple question, but I'm stuck with this: How can I set a href in a html:link tag with a string concatenated with a bean:write...? I mean, I want to do something like this: html:link href=getorg.do?id=bean:write name=orglist property=id/bean:write name=orglist property=id//html:link Of course, this doesn't work. I want href to have the string getorg.do?id= concatenated with the output from bean:write name=orglist property=id/ I suppose this must be done with a scriptlet. By the way, the orglist bean comes from a logic:iterate over a vector of Beans (named orglistview). Anyone? Thanks, Antonio Santos - 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 put a bean:write in a href=
I hate dollar signs :o) I'd do this html:link page=/gtorg.do paramId=id paramName=orglist paramProperty=id I Love Sparrows!!! /html:link Mark On Wednesday, Jun 4, 2003, at 17:03 Europe/London, Chen, Gin wrote: 2 possibilities without using scriplets: 1) Struts-EL: html-el:link href=/getorg.do?id=${orglist.id}/ 2) JSTL: c:url value=/getorg.do c:param name=id value=${orglist.id}/ /c:url -Tim -Original Message- From: António Santos [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 12:54 PM To: [EMAIL PROTECTED] Subject: how to put a bean:write in a href= Hi all, Maybe this is a simple question, but I'm stuck with this: How can I set a href in a html:link tag with a string concatenated with a bean:write...? I mean, I want to do something like this: html:link href=getorg.do?id=bean:write name=orglist property=id/bean:write name=orglist property=id//html:link Of course, this doesn't work. I want href to have the string getorg.do?id= concatenated with the output from bean:write name=orglist property=id/ I suppose this must be done with a scriptlet. By the way, the orglist bean comes from a logic:iterate over a vector of Beans (named orglistview). Anyone? Thanks, Antonio Santos - 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: RE: how to put a bean:write in a href=
Thanks. Nice tip. By the way, is there any other way to put a bean property in a value attribute of an input of a HTML form? I mean, supposing that I have a orgview bean, is there a better way to do this (which of course doesn't work): html:text property=id value=bean:write name=orgview property=id// in order to put the orgview's id property value in the value attribute of the html:text tag? Must I put a bean:define tag before and then use a scriplet inside the value attribute? This is tiresome if if I have several HTML inputs in a form... Thanks again, Antonio Santos --- Do this html:link href=getorg.do paramId=id paramName=orglist paramProperty=id -Original Message- From: António Santos [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 11:54 AM To: [EMAIL PROTECTED] Subject: how to put a bean:write in a href= Hi all, Maybe this is a simple question, but I'm stuck with this: How can I set a href in a html:link tag with a string concatenated with a bean:write...? I mean, I want to do something like this: html:link href=getorg.do?id=bean:write name=orglist property=id/bean:write name=orglist property=id//html:link Of course, this doesn't work. I want href to have the string getorg.do?id= concatenated with the output from bean:write name=orglist property=id/ I suppose this must be done with a scriptlet. By the way, the orglist bean comes from a logic:iterate over a vector of Beans (named orglistview). Anyone? Thanks, Antonio Santos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: how to put a bean:write in a href=
By the way, is there any other way to put a bean property in a value attribute of an input of a HTML form? I mean, supposing that I have a orgview bean, is there a better way to do this (which of course doesn't work): html:text property=id value=bean:write name=orgview property=id// in order to put the orgview's id property value in the value attribute of the html:text tag? Must I put a bean:define tag before and then use a scriplet inside the value attribute? This is tiresome if if I have several HTML inputs in a form... Total guess, but this might be what you want: html:test property=myParam name=orgview value=id / -- Mike W. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE: how to put a bean:write in a href=
No way to embed custom tags so AFAIK it is the only chance: bean:define id=pepe name=orgview property=id/ html:text property=id value=pepe/ Adolfo From: António Santos [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: RE: how to put a bean:write in a href= Date: Wed, 4 Jun 2003 20:40:24 + Thanks. Nice tip. By the way, is there any other way to put a bean property in a value attribute of an input of a HTML form? I mean, supposing that I have a orgview bean, is there a better way to do this (which of course doesn't work): html:text property=id value=bean:write name=orgview property=id// in order to put the orgview's id property value in the value attribute of the html:text tag? Must I put a bean:define tag before and then use a scriplet inside the value attribute? This is tiresome if if I have several HTML inputs in a form... Thanks again, Antonio Santos --- Do this html:link href=getorg.do paramId=id paramName=orglist paramProperty=id -Original Message- From: António Santos [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 11:54 AM To: [EMAIL PROTECTED] Subject: how to put a bean:write in a href= Hi all, Maybe this is a simple question, but I'm stuck with this: How can I set a href in a html:link tag with a string concatenated with a bean:write...? I mean, I want to do something like this: html:link href=getorg.do?id=bean:write name=orglist property=id/bean:write name=orglist property=id//html:link Of course, this doesn't work. I want href to have the string getorg.do?id= concatenated with the output from bean:write name=orglist property=id/ I suppose this must be done with a scriptlet. By the way, the orglist bean comes from a logic:iterate over a vector of Beans (named orglistview). Anyone? Thanks, Antonio Santos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE: how to put a bean:write in a href=
I meant: bean:define id=pepe name=orgview property=id/ html:text property=id value=%=pepe%/ From: Adolfo Miguelez [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: RE: how to put a bean:write in a href= Date: Wed, 04 Jun 2003 19:54:18 + No way to embed custom tags so AFAIK it is the only chance: bean:define id=pepe name=orgview property=id/ html:text property=id value=pepe/ Adolfo From: António Santos [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: RE: how to put a bean:write in a href= Date: Wed, 4 Jun 2003 20:40:24 + Thanks. Nice tip. By the way, is there any other way to put a bean property in a value attribute of an input of a HTML form? I mean, supposing that I have a orgview bean, is there a better way to do this (which of course doesn't work): html:text property=id value=bean:write name=orgview property=id// in order to put the orgview's id property value in the value attribute of the html:text tag? Must I put a bean:define tag before and then use a scriplet inside the value attribute? This is tiresome if if I have several HTML inputs in a form... Thanks again, Antonio Santos --- Do this html:link href=getorg.do paramId=id paramName=orglist paramProperty=id -Original Message- From: António Santos [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 11:54 AM To: [EMAIL PROTECTED] Subject: how to put a bean:write in a href= Hi all, Maybe this is a simple question, but I'm stuck with this: How can I set a href in a html:link tag with a string concatenated with a bean:write...? I mean, I want to do something like this: html:link href=getorg.do?id=bean:write name=orglist property=id/bean:write name=orglist property=id//html:link Of course, this doesn't work. I want href to have the string getorg.do?id= concatenated with the output from bean:write name=orglist property=id/ I suppose this must be done with a scriptlet. By the way, the orglist bean comes from a logic:iterate over a vector of Beans (named orglistview). Anyone? Thanks, Antonio Santos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: href
Michael Burke wrote: I've got a jsp page that iterates through a list of web links, I can t figure out how to use just the link without it being appended to http://localhost... Here's the page in question: %@ taglib uri=/bean prefix=bean % %@ taglib uri=/html prefix=html % %@ taglib uri=/logic prefix=logic % %@ taglib uri=/template prefix=template % br/ html:errors/ br/ table cellpadding=2 width=80% tr td /td td bCategories/b /td /tr logic:iterate name=allLinksList id=links scope=request type=linkapp.entity.Links tr td a href='bean:write name=links property=url/' bean:write name=links property=url//a /td /tr /logic:iterate /table - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] I thought this was an easy question, as I said in my first post when I iterate and print a list of hyperlinks the link gets appended to the link of my webapp (http://localhost:8080/linkapp) instead of just being an independant link. any suggestions would be appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: href
Michael Burke wrote: I've got a jsp page that iterates through a list of web links, I can t figure out how to use just the link without it being appended to http://localhost... Here's the page in question: %@ taglib uri=/bean prefix=bean % %@ taglib uri=/html prefix=html % %@ taglib uri=/logic prefix=logic % %@ taglib uri=/template prefix=template % br/ html:errors/ br/ table cellpadding=2 width=80% tr td /td td bCategories/b /td /tr logic:iterate name=allLinksList id=links scope=request type=linkapp.entity.Links tr td a href='bean:write name=links property=url/' bean:write name=links property=url//a /td /tr /logic:iterate /table - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Sorry for the questions, I realized if I didn't enter a correct address (http://www...) it gets appended to my webapp address. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: href
bean:write name=links property=url//a bean:write only print your bean property value in JSP outputStream. You should look at data type used for your url property, and it's toString() method. Nico. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
href
I've got a jsp page that iterates through a list of web links, I can t figure out how to use just the link without it being appended to http://localhost... Here's the page in question: %@ taglib uri=/bean prefix=bean % %@ taglib uri=/html prefix=html % %@ taglib uri=/logic prefix=logic % %@ taglib uri=/template prefix=template % br/ html:errors/ br/ table cellpadding=2 width=80% tr td /td td bCategories/b /td /tr logic:iterate name=allLinksList id=links scope=request type=linkapp.entity.Links tr td a href='bean:write name=links property=url/' bean:write name=links property=url//a /td /tr /logic:iterate /table - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
href to perform an action
I have a jsp with a list of shipment data where hrefs are defined on the equipment keys. I would like the client to click on the link to drill down from the list to a detailed jsp. If I do the following: a href=/vcsc/shipmentTracking.do?equipmentNumber=MATU33445 I get a 404 url not found. How do I get the link to go to the shipmentTracking Action? Do I need to create a form on the jsp and use the onClick javascript to set the action of the form? Thanks in advance, Cindy -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: [href to perform an action]
Responses below... Cindy Horn at SF x4874 [EMAIL PROTECTED] wrote: I have a jsp with a list of shipment data where hrefs are defined on the equipment keys. I would like the client to click on the link to drill down from the list to a detailed jsp. If I do the following: a href=/vcsc/shipmentTracking.do?equipmentNumber=MATU33445 I get a 404 url not found. How do I get the link to go to the shipmentTracking Action? Do I need to create a form on the jsp and use the onClick javascript to set the action of the form? First, that should technically work, assuming that that is the correct relative path to the action. Make sure you have the correct path being defined. (As a hint, when you click the link and get a 404, look at what is in the address bar at that point. I have found that the webapp base is usually lost if you do an HREF such as this.) Second, though, I would recommend using the html:link tag for things such as this. Used in conjunction with global-forwards for your actions, this relieves you of having to worry about keeping the web-app base, and it also gives a lot of flexibility with the creation of the queryString. Examples are in the users guide, though I would be happy to provide you with some more, if you need. -josh -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: href to perform an action
No, if #1 is your application name (i.e. you deployed vcsc.war) and #2 is correctly defined in your struts-config, then all should be fine (btw. case matters) a href=/vcsc/shipmentTracking.do?equipmentNumber=MATU33445 #1#2 James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein (1879-1955) -Original Message- From: Cindy Horn at SF x4874 [mailto:CHorn;matson.com] Sent: Wednesday, October 30, 2002 12:58 PM To: Struts (E-mail) Subject: href to perform an action I have a jsp with a list of shipment data where hrefs are defined on the equipment keys. I would like the client to click on the link to drill down from the list to a detailed jsp. If I do the following: a href=/vcsc/shipmentTracking.do?equipmentNumber=MATU33445 I get a 404 url not found. How do I get the link to go to the shipmentTracking Action? Do I need to create a form on the jsp and use the onClick javascript to set the action of the form? Thanks in advance, Cindy -- 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: href to perform an action
I've tried the html:link tag and I get a 500: 10.3.5.43 - - [30/Oct/2002:12:05:42 -0800] GET /vcsc/shipmentTracking.do?equipmentNumber=MATU334466 HTTP/1.1 500 53 This is the tag I'm using: html:link href=/vcsc/shipmentTracking.do paramId=equipmentNumber paramName=container paramProperty=equipmentNumber bean:write name=container property=equipmentNumber//html:link I have debugging lines in my Action class and those are not getting invoked. Does the action class not accept a GET? -Original Message- From: Penubothu, Rajani [mailto:rpenubothu;epocrates.com] Sent: Wednesday, October 30, 2002 10:17 AM To: '[EMAIL PROTECTED]' Subject: Re: href to perform an action You might want to checkout html:link/ tag. Using that tag, you need to use attributes page=/vcsc/shipmentTracking.do. You can even pass parameters using other attributes like paramProperty,paramId and paramName etc Thanks,Rajani. Cindy Horn at SF x4874 [EMAIL PROTECTED] wrote in message news:769F76EB4C93D31192850008C7B98C1106097180@mnc03p2e... I have a jsp with a list of shipment data where hrefs are defined on the equipment keys. I would like the client to click on the link to drill down from the list to a detailed jsp. If I do the following: a href=/vcsc/shipmentTracking.do?equipmentNumber=MATU33445 I get a 404 url not found. How do I get the link to go to the shipmentTracking Action? Do I need to create a form on the jsp and use the onClick javascript to set the action of the form? Thanks in advance, Cindy -- 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: href to perform an action
Then why would this not work? The first line I have in my perform method is a debug line and this is not showing up. It's behaving as though it can not find the action class. Here is my definition in the config file: action path=/shipmentTracking type=com.matson.shipment.web.ShipmentTrackingAction name=shipmentTrackingForm scope=session -Original Message- From: David Graham [mailto:dgraham1980;hotmail.com] Sent: Wednesday, October 30, 2002 12:46 PM To: [EMAIL PROTECTED] Subject: RE: href to perform an action Actions do accept GET requests. From: Cindy Horn at SF x4874 [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts (E-mail) [EMAIL PROTECTED] Subject: RE: href to perform an action Date: Wed, 30 Oct 2002 12:25:32 -0800 I've tried the html:link tag and I get a 500: 10.3.5.43 - - [30/Oct/2002:12:05:42 -0800] GET /vcsc/shipmentTracking.do?equipmentNumber=MATU334466 HTTP/1.1 500 53 This is the tag I'm using: html:link href=/vcsc/shipmentTracking.do paramId=equipmentNumber paramName=container paramProperty=equipmentNumber bean:write name=container property=equipmentNumber//html:link I have debugging lines in my Action class and those are not getting invoked. Does the action class not accept a GET? -Original Message- From: Penubothu, Rajani [mailto:rpenubothu;epocrates.com] Sent: Wednesday, October 30, 2002 10:17 AM To: '[EMAIL PROTECTED]' Subject: Re: href to perform an action You might want to checkout html:link/ tag. Using that tag, you need to use attributes page=/vcsc/shipmentTracking.do. You can even pass parameters using other attributes like paramProperty,paramId and paramName etc Thanks,Rajani. Cindy Horn at SF x4874 [EMAIL PROTECTED] wrote in message news:769F76EB4C93D31192850008C7B98C1106097180@mnc03p2e... I have a jsp with a list of shipment data where hrefs are defined on the equipment keys. I would like the client to click on the link to drill down from the list to a detailed jsp. If I do the following: a href=/vcsc/shipmentTracking.do?equipmentNumber=MATU33445 I get a 404 url not found. How do I get the link to go to the shipmentTracking Action? Do I need to create a form on the jsp and use the onClick javascript to set the action of the form? Thanks in advance, Cindy -- 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 _ Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp -- 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: href to perform an action
500 is an internal server error. Can you check your log files and try to find more detail or even a stack trace? James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein (1879-1955) -Original Message- From: Cindy Horn at SF x4874 [mailto:CHorn;matson.com] Sent: Wednesday, October 30, 2002 5:15 PM To: 'Struts Users Mailing List' Subject: RE: href to perform an action Then why would this not work? The first line I have in my perform method is a debug line and this is not showing up. It's behaving as though it can not find the action class. Here is my definition in the config file: action path=/shipmentTracking type=com.matson.shipment.web.ShipmentTrackingAction name=shipmentTrackingForm scope=session -Original Message- From: David Graham [mailto:dgraham1980;hotmail.com] Sent: Wednesday, October 30, 2002 12:46 PM To: [EMAIL PROTECTED] Subject: RE: href to perform an action Actions do accept GET requests. From: Cindy Horn at SF x4874 [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts (E-mail) [EMAIL PROTECTED] Subject: RE: href to perform an action Date: Wed, 30 Oct 2002 12:25:32 -0800 I've tried the html:link tag and I get a 500: 10.3.5.43 - - [30/Oct/2002:12:05:42 -0800] GET /vcsc/shipmentTracking.do?equipmentNumber=MATU334466 HTTP/1.1 500 53 This is the tag I'm using: html:link href=/vcsc/shipmentTracking.do paramId=equipmentNumber paramName=container paramProperty=equipmentNumber bean:write name=container property=equipmentNumber//html:link I have debugging lines in my Action class and those are not getting invoked. Does the action class not accept a GET? -Original Message- From: Penubothu, Rajani [mailto:rpenubothu;epocrates.com] Sent: Wednesday, October 30, 2002 10:17 AM To: '[EMAIL PROTECTED]' Subject: Re: href to perform an action You might want to checkout html:link/ tag. Using that tag, you need to use attributes page=/vcsc/shipmentTracking.do. You can even pass parameters using other attributes like paramProperty,paramId and paramName etc Thanks,Rajani. Cindy Horn at SF x4874 [EMAIL PROTECTED] wrote in message news:769F76EB4C93D31192850008C7B98C1106097180@mnc03p2e... I have a jsp with a list of shipment data where hrefs are defined on the equipment keys. I would like the client to click on the link to drill down from the list to a detailed jsp. If I do the following: a href=/vcsc/shipmentTracking.do?equipmentNumber=MATU33445 I get a 404 url not found. How do I get the link to go to the shipmentTracking Action? Do I need to create a form on the jsp and use the onClick javascript to set the action of the form? Thanks in advance, Cindy -- 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 _ Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp -- 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: href to perform an action
The generated link must look like: a href=/context/shipmentTracking.do?param1=value1link/a If you have that link and it still doesn't work, it's likely to be your Action class. Try substituting your action for the struts ForwardAction and see what happens. David From: Cindy Horn at SF x4874 [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: href to perform an action Date: Wed, 30 Oct 2002 14:15:06 -0800 Then why would this not work? The first line I have in my perform method is a debug line and this is not showing up. It's behaving as though it can not find the action class. Here is my definition in the config file: action path=/shipmentTracking type=com.matson.shipment.web.ShipmentTrackingAction name=shipmentTrackingForm scope=session -Original Message- From: David Graham [mailto:dgraham1980;hotmail.com] Sent: Wednesday, October 30, 2002 12:46 PM To: [EMAIL PROTECTED] Subject: RE: href to perform an action Actions do accept GET requests. From: Cindy Horn at SF x4874 [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts (E-mail) [EMAIL PROTECTED] Subject: RE: href to perform an action Date: Wed, 30 Oct 2002 12:25:32 -0800 I've tried the html:link tag and I get a 500: 10.3.5.43 - - [30/Oct/2002:12:05:42 -0800] GET /vcsc/shipmentTracking.do?equipmentNumber=MATU334466 HTTP/1.1 500 53 This is the tag I'm using: html:link href=/vcsc/shipmentTracking.do paramId=equipmentNumber paramName=container paramProperty=equipmentNumber bean:write name=container property=equipmentNumber//html:link I have debugging lines in my Action class and those are not getting invoked. Does the action class not accept a GET? -Original Message- From: Penubothu, Rajani [mailto:rpenubothu;epocrates.com] Sent: Wednesday, October 30, 2002 10:17 AM To: '[EMAIL PROTECTED]' Subject: Re: href to perform an action You might want to checkout html:link/ tag. Using that tag, you need to use attributes page=/vcsc/shipmentTracking.do. You can even pass parameters using other attributes like paramProperty,paramId and paramName etc Thanks,Rajani. Cindy Horn at SF x4874 [EMAIL PROTECTED] wrote in message news:769F76EB4C93D31192850008C7B98C1106097180@mnc03p2e... I have a jsp with a list of shipment data where hrefs are defined on the equipment keys. I would like the client to click on the link to drill down from the list to a detailed jsp. If I do the following: a href=/vcsc/shipmentTracking.do?equipmentNumber=MATU33445 I get a 404 url not found. How do I get the link to go to the shipmentTracking Action? Do I need to create a form on the jsp and use the onClick javascript to set the action of the form? Thanks in advance, Cindy -- 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 _ Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp -- 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 _ Unlimited Internet access -- and 2 months free! Try MSN. http://resourcecenter.msn.com/access/plans/2monthsfree.asp -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: href to perform an action
you have to add an input attribute to your action definition that points to the jsp that has your form on it. Struts needs to know where to forward to when there are errors. Validation is done in the ActionForm.validate() method. See the users guide for details. David From: Cindy Horn at SF x4874 [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: href to perform an action Date: Wed, 30 Oct 2002 15:25:23 -0800 This is the error I have in the log: [WebAppServletContext(852414,vcsc,/vcsc)] action: No input form, but validation returned errors Where is this validation taking place? -Original Message- From: James Mitchell [mailto:jmitchtx;telocity.com] Sent: Wednesday, October 30, 2002 2:24 PM To: Struts Users Mailing List Subject: RE: href to perform an action 500 is an internal server error. Can you check your log files and try to find more detail or even a stack trace? James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein (1879-1955) -Original Message- From: Cindy Horn at SF x4874 [mailto:CHorn;matson.com] Sent: Wednesday, October 30, 2002 5:15 PM To: 'Struts Users Mailing List' Subject: RE: href to perform an action Then why would this not work? The first line I have in my perform method is a debug line and this is not showing up. It's behaving as though it can not find the action class. Here is my definition in the config file: action path=/shipmentTracking type=com.matson.shipment.web.ShipmentTrackingAction name=shipmentTrackingForm scope=session -Original Message- From: David Graham [mailto:dgraham1980;hotmail.com] Sent: Wednesday, October 30, 2002 12:46 PM To: [EMAIL PROTECTED] Subject: RE: href to perform an action Actions do accept GET requests. From: Cindy Horn at SF x4874 [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts (E-mail) [EMAIL PROTECTED] Subject: RE: href to perform an action Date: Wed, 30 Oct 2002 12:25:32 -0800 I've tried the html:link tag and I get a 500: 10.3.5.43 - - [30/Oct/2002:12:05:42 -0800] GET /vcsc/shipmentTracking.do?equipmentNumber=MATU334466 HTTP/1.1 500 53 This is the tag I'm using: html:link href=/vcsc/shipmentTracking.do paramId=equipmentNumber paramName=container paramProperty=equipmentNumber bean:write name=container property=equipmentNumber//html:link I have debugging lines in my Action class and those are not getting invoked. Does the action class not accept a GET? -Original Message- From: Penubothu, Rajani [mailto:rpenubothu;epocrates.com] Sent: Wednesday, October 30, 2002 10:17 AM To: '[EMAIL PROTECTED]' Subject: Re: href to perform an action You might want to checkout html:link/ tag. Using that tag, you need to use attributes page=/vcsc/shipmentTracking.do. You can even pass parameters using other attributes like paramProperty,paramId and paramName etc Thanks,Rajani. Cindy Horn at SF x4874 [EMAIL PROTECTED] wrote in message news:769F76EB4C93D31192850008C7B98C1106097180@mnc03p2e... I have a jsp with a list of shipment data where hrefs are defined on the equipment keys. I would like the client to click on the link to drill down from the list to a detailed jsp. If I do the following: a href=/vcsc/shipmentTracking.do?equipmentNumber=MATU33445 I get a 404 url not found. How do I get the link to go to the shipmentTracking Action? Do I need to create a form on the jsp and use the onClick javascript to set the action of the form? Thanks in advance, Cindy -- 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 _ Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp -- 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 -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
href to perform an action
Hi, I have a doubt related to this and the html-img tag. a href=javascript:window.location.reload(true) img name=img1 src=images/img1.gif width=38 height=34 border=0 alt= /a I am refreshing some data in the session scope when the user hits the reload button. I am planning to use html-img tag if it really helps. The href shown above already reloads the current page. I am using a simple NoDataForm as advised. How can I both reload the current page throught javascript and refresh the session variable throught an action? Will html-img help here? bye, Mohan -Original Message- From: David Graham [mailto:dgraham1980;hotmail.com] Sent: Thursday, October 31, 2002 7:29 AM To: [EMAIL PROTECTED] Subject: RE: href to perform an action you have to add an input attribute to your action definition that points to the jsp that has your form on it. Struts needs to know where to forward to when there are errors. Validation is done in the ActionForm.validate() method. See the users guide for details. David From: Cindy Horn at SF x4874 [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: href to perform an action Date: Wed, 30 Oct 2002 15:25:23 -0800 This is the error I have in the log: [WebAppServletContext(852414,vcsc,/vcsc)] action: No input form, but validation returned errors Where is this validation taking place? -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
javascript with a href
When I click on the edit, delete bid or Accept Bid links in the logic tags below nothing happens. Any suggestions why? % taglib uri=/bean prefix=bean % % taglib uri=/html prefix=html % % taglib uri=/logic prefix=logic % % taglib uri=/template prefix=template % br/ html:errors/ br/ script language=javascript function editOffer() { offerList.action = editOffer.do?action=edit; offerList.actn.value = edit; offerList.submit(); } function deleteOffer() { offerList.action = deleteOffer.do; offerList.actn.value = delete; offerList.submit(); } function acceptBid() { offerList.action = acceptBid.do; offerList.actn.value = accept; offerList.submit(); } function bid() { offerList.action = bid.do; offerList.actn.value = bid; offerList.submit(); } /script form name=offerList input type=hidden name=actn/ table cellpadding=2 width=80% tr td /td td bUser/b /td td bName/b /td td bDescription/b /td td bExpected Value/b /td td bMax Bid/b /td /tr logic:iterate name=offerList id=offer scope=request type=auction.entity.Offer tr bean:define id=offerId name=offer property=offerId/ td input type=radio name=offerId checked value=%= offerId %/ /td td bean:write name=offer property=userId/ /td td bean:write name=offer property=name/ /td td bean:write name=offer property=description/ /td td bean:write name=offer property=expectedValue/ /td td bean:write name=offer property=maxBid/ /td /tr /logic:iterate tr td colspan=6 align=center logic:equal parameter=actn value=public input type=text name=bidValue/ nbsp; a href=javascript:bid()Bid/a /logic:equal logic:equal parameter=actn value=mine a href=javascript:editOffer()Edit/a nbsp; a href=javascript:deleteOffer()Delete/a nbsp; a href=javascript:acceptBid()Accept Bid/a nbsp; /logic:equal /td /tr /table /form -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: base href (html:base) tag
Both approaches work fine, in fact we had a discussion about using Both. Actually the BASE tag just works fine, the same view may be generated by Any action and the JSP URL will get masked by the one from where The jsp is called(forwarded action). Base tag supports all the other Reference links(like stylesheets,images etc etc) on the page, and it is already available (we don't Need to re-desing/re-write anything). Anand -Original Message- From: Dylan MacDonald [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 24, 2002 12:04 PM To: [EMAIL PROTECTED] Subject: base href (html:base) tag Hi - I'm a bit of a newbie to Struts so I hope you can bear with me. I'm one of several developers working on a struts framework Registration project for my company. We are currently having an internal debate as to how to set up application contexts and asset pathing in our JSP pages for this and future projects we are slated to build. The Java Architect on the project believes we should use the html:base/ tag in our JSPs. That way we can set the context (or pathing) via the taglib. This would help for transferring files between our Dev and Production environments, for example. A few of the web developers believe that we should set a J2EE directive which maps all requests to the application context we set. That way, we can set the pathing to be whatever we want without being constrained by what the Base Href is. By using html:base/, I assume that we will be adding a BASE HREF tag to the top of every JSP page. I think this is odd. I never set a BASE HREF tag unless I want to view the page completely out of context (like on my desktop). Moreover, who really uses BASE HREF on every JSP page? I almost never see it in the source code of sites I visit. It just strikes me as odd and an unusual practice. Any thoughts? Thanks, Dylan MacDonald -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
dynamic href variable
How do I populate the href attribute in the html:link tag? I have the following code with a bean 'score' that contains the url I want to put in the hyperlink tag. html:link href=xxx target=_new bean:write name=score property=url/ /html:link where xxx should be the same as the body of this (Bean:write ) how can I populate the href with the dynamic content? Obviously, you cannot put the bean:write ... tag into it. By the way: it would be really helpful if we created example pages for the major tags and their usages. Somehow the documentation works only for people who know this fairly well. A lot of the questions could be avoided! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Building a dynamic list of html (href) links from a Map
Hi I am trying to build a dynamic list of links (href's) from a map that has been created in my Action class and put into the request for the JSP. My map looks something like this: key: Log On Value: /logon.do key: Display Users value: /displayusers.do Is there a way to use the html:link tag to build these links so that I would get something like: a href=/myapp/logon.doLog On/a br a href=/myapp/displayusers.doDisplay Users/a Is this possible or should I just use plain HTML to build the list of links? TIA, Karim -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Why bean:include href=... .../ is encoded
Hi, i am using the bean:include tag to insert different content in a page. Now i am supprised, that the url within this tag is encoded with the complete path (http://.../.../;). The doc says that it will be like it is. But if i want to use a local file then the whole url is used and if i connect from external via dyndns the resource was not found. Any ideas ? so long Ingo Bruell --- [EMAIL PROTECTED] [EMAIL PROTECTED] ICQ# 40377720 OldenburgPGP-Fingerprint: CB01 AE12 B359 87C4 BF1C 953C 8FE7 C648 169E E5FC Germany PGP-Public-Key available at pgpkeys.mit.edu -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Help to manage html href tag with sruts
I did this: html:link href=%mailTo + actionForm.getUserEmail()% etc. I defined mailTo as a String = mailto:; Hope this answers your question -Original Message- From: Apollinaire Coulibaly [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 12:41 PM To: [EMAIL PROTECTED] Subject: Help to manage html href tag with sruts Hi all, I've the following situation: I have to manage this html tag a href=mailto:%=userEmail% . Can some tell to me how to manage it using taglibrary? how can I pass the user email adress to the tag as: html:link href=??? Thanks all PitB -- ___ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This email and any files transmitted with it are confidential and are intended for the sole use of the individual to whom they are addressed. Black Box Corporation reserves the right to scan all e-mail traffic for restricted content and to monitor all e-mail in general. If you are not the intended recipient or you have received this email in error, any use, dissemination or forwarding of this email is strictly prohibited. If you have received this email in error, please notify the sender by replying to this email.
HREF issue
Hi I am waiting for the solution for my problem for someone and seems no one is responding to it.I dunno know why this is happening.I would highly appreciate if someone could help me solve my problem. here i am stating my problem once again. I am having an issue with html:link tag of struts. I think I don't know how to use it. Actually I have a java script fucntion which looks like this function launchEdit(field, accField, relation, newType) { currentField = document.editForm.field; currentAccField = document.editForm.accField; isRelation = relation; var url = 'LoadObject.do?parent=trueaction=Edittype='+newType+'accNum='+accField.value; window.open(url,'CreateNew','height=500,width=550,resizable=1,scrollbars=1'); } And it needs to be called by passing the parameters that would also be dynamic for me (which will change everytime we call it.) Can Someone throw some light on this issue as to how we achieve this functionality . I would be highly thankful to you. Thanks in Advance Sidhartha -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HREF issue
I've used the following style and it's worked could probably streamline it a bit with a custom tag or something: SCRIPT language=JavaScript function openWindow() { window.open( , CreateNew, height=500,width=550,resizable=1,scrollbars=1 ); } /SCRIPT html:link page=LoadObject.do?parent=trueaction=Edittype=%= newType %accNum=%= accField.value% target=CreateNew onclick=openWindow(); bean:message key=whatever.the.link.name.is/ /html:link _\|/___ generation-d development andrew b forman -Original Message- From: Sidhartha Jain [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 8:52 AM To: [EMAIL PROTECTED] Subject: HREF issue Hi I am waiting for the solution for my problem for someone and seems no one is responding to it.I dunno know why this is happening.I would highly appreciate if someone could help me solve my problem. here i am stating my problem once again. I am having an issue with html:link tag of struts. I think I don't know how to use it. Actually I have a java script fucntion which looks like this function launchEdit(field, accField, relation, newType) { currentField = document.editForm.field; currentAccField = document.editForm.accField; isRelation = relation; var url = 'LoadObject.do?parent=trueaction=Edittype='+newType+'accNum='+a ccField.value; window.open(url,'CreateNew','height=500,width=550,resizable=1,scro llbars=1'); } And it needs to be called by passing the parameters that would also be dynamic for me (which will change everytime we call it.) Can Someone throw some light on this issue as to how we achieve this functionality . I would be highly thankful to you. Thanks in Advance Sidhartha -- 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]
Fwd: Href issue
Hi I am having an issue with html:link tag of struts. I think I don't know how to use it. Actually I have a java script fucntion which looks like this function launchEdit(field, accField, relation, newType) { currentField = document.editForm.field; currentAccField = document.editForm.accField; isRelation = relation; var url = 'LoadObject.do?parent=trueaction=Edittype='+newType+'accNum='+accField.value; window.open(url,'CreateNew','height=500,width=550,resizable=1,scrollbars=1'); } And it needs to be called by passing the parameters that would also be dynamic for me (which will change everytime we call it.) Can Someone throw some light on this issue as to how we achieve this functionality . I would be highly thankful to you. Thanks in Advance Sidhartha ---BeginMessage--- Hi I am having an issue with html:link tag of struts. I think I don't know how to use it. Actually I have a java script fucntion which looks like this function launchEdit(field, accField, relation, newType) { currentField = document.editForm.field; currentAccField = document.editForm.accField; isRelation = relation; var url = 'LoadObject.do?parent=trueaction=Edittype='+newType+'accNum='+accField.value; window.open(url,'CreateNew','height=500,width=550,resizable=1,scrollbars=1'); } And it needs to be called by passing the parameters that would also be dynamic for me (which will change everytime we call it.) Can Someone throw some light on this issue as to how we achieve this functionality . I would be highly thankful to you. Thanks in Advance Sidhartha ---End Message--- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Question on forwarding/redirecting/href usage...
When I use ActionForward I supply it the Context-relative URI to which control should be forwarded. However, when I want to use a href=... I cannot use the Context-relative URI. Thus my returnTo= backlink works correctly if I use it with the ActionForward, but fails to work when used with a href tag. Is there a BEAN/TAG/METHOD that would convert a Context-relative URI to something that I can use with an anchor tag? I guess I could always call request.getContext() and prepend that to the URI, however, this will only work if the URI is context-relative. In case URI is page-relative, no such append is needed. Is there something in JSP/Servlet/Struts that would do these checks for me? Thanks. -AP_ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Question on forwarding/redirecting/href usage...
try using html:link page=.../html:link instead of a href=/a -- Original Message -- When I use ActionForward I supply it the Context-relative URI to which control should be forwarded. However, when I want to use a href=... I cannot use the Context-relative URI. Thus my returnTo= backlink works correctly if I use it with the ActionForward, but fails to work when used with a href tag. Is there a BEAN/TAG/METHOD that would convert a Context-relative URI to something that I can use with an anchor tag? I guess I could always call request.getContext() and prepend that to the URI, however, this will only work if the URI is context-relative. In case URI is page-relative, no such append is needed. Is there something in JSP/Servlet/Struts that would do these checks for me? Thanks. -AP_ -- 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: Question on forwarding/redirecting/href usage...
I looked at html:link, and it seems to require using a Map class to pass parameters to the link. Seems like a lot of setup, and scriplet code (which I am not crazy about) just to generate /school/maintenance.jsp?schoolId=223context=ready. Is there an easier way to do this? Here is how I imagine the code would look like with the current STRUTS html:link tag: bean:define id=schoolId name=school property=id/ bean:define id=contextMode name=school property=context/ % Map map = new HashMap(); map.put(schoolId, schoolId); map.put(context, contextMode); % html:link href=/school/maintenance.jsp name=map / I would rather see syntax like this: html:link href=/school/maintenance.jsp html:linkParam id=schoolId name=school property=id/ html:linkParam id=context name=school property=context/ /html The map, is a good feature, but it's TOO dynamic in this case. I could create my own tag, but I thought I would ask around before re-inventing the wheel. Thanks. -AP_ -Original Message- From: neel [mailto:[EMAIL PROTECTED]] Sent: Monday, January 21, 2002 11:25 AM To: Struts Users Mailing List Subject: RE: Question on forwarding/redirecting/href usage... try using html:link page=.../html:link instead of a href=/a -- Original Message -- When I use ActionForward I supply it the Context-relative URI to which control should be forwarded. However, when I want to use a href=... I cannot use the Context-relative URI. Thus my returnTo= backlink works correctly if I use it with the ActionForward, but fails to work when used with a href tag. Is there a BEAN/TAG/METHOD that would convert a Context-relative URI to something that I can use with an anchor tag? I guess I could always call request.getContext() and prepend that to the URI, however, this will only work if the URI is context-relative. In case URI is page-relative, no such append is needed. Is there something in JSP/Servlet/Struts that would do these checks for me? Thanks. -AP_ -- 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]
Solved: Access to localized messages to build an href
Got around it by using the actual locale: %@ page import=org.apache.struts.action.Action % bean:define id=locale name=%=Action.LOCALE_KEY% type=java.util.Locale/ a href=%=refstart + locale.toString() + /refend.html%Click here /a I still haven't answered my original question, but it's now moot. -Original Message- From: Jim Tomlinson Sent: Monday, January 07, 2002 3:39 PM To: '[EMAIL PROTECTED]' Subject: Access to localized messages to build an href I'm trying to get access to the MessageResources object that, according to the docs, is an application scope bean. I need to build an href in this manner: a href=%=refstart + bean:message key=footer_locale/ + /refend.html%Click here /a Of course, this doesn't work (with single quotes, either, as suggested for a similar problem on this list). I've worked around it like this: % MessageResources resources = MessageResources.getMessageResources(com.foo.bar.Resources); String locale = resources.getMessage(footer_locale); % a href=%=refstart + locale + /refend.html%Click here /a but I'd like to avoid the scriptlet. What name is the MessageResources object registered as in the application scope, so I can use bean:define to get at it? Or is there another way to accomplish this without using the scriptlet (no, I don't want to put the entire href in the resource file). Thanks. -- Jim Tomlinson [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Access to localized messages to build an href
I'm trying to get access to the MessageResources object that, according to the docs, is an application scope bean. I need to build an href in this manner: a href=%=refstart + bean:message key=footer_locale/ + /refend.html%Click here /a Of course, this doesn't work (with single quotes, either, as suggested for a similar problem on this list). I've worked around it like this: % MessageResources resources = MessageResources.getMessageResources(com.foo.bar.Resources); String locale = resources.getMessage(footer_locale); % a href=%=refstart + locale + /refend.html%Click here /a but I'd like to avoid the scriptlet. What name is the MessageResources object registered as in the application scope, so I can use bean:define to get at it? Or is there another way to accomplish this without using the scriptlet (no, I don't want to put the entire href in the resource file). Thanks. -- Jim Tomlinson [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: converting A HREF to submit...
With standard html you can do this: input type=hidden name=action value=default a href= onClick=myForm.action.value='link1';myForm.submit() This way, the submitted form will now have a NV pair of action=link1 as well as the rest of the form values. Trever - Original Message - From: Marcelo Caldas - CCSC [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, December 11, 2001 8:19 AM Subject: converting A HREF to submit... Hi, Someone knows a way to convert a A HREF linK into a form submit I know that I can use A HREF=... onClick=submit(), but my problem is that I have several links with that, and I need to know which one the user clicked on... Any sugestions? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: converting A HREF to submit...
Hi, Just in your onClick call a some method with a parameter and inside that method you check the condition that's all. Cheer's Kicha Marcelo Caldas - CCSC wrote: Hi, Someone knows a way to convert a A HREF linK into a form submit I know that I can use A HREF=... onClick=submit(), but my problem is that I have several links with that, and I need to know which one the user clicked on... Any sugestions? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
html:link href to external URL in a
Hi This may be in the FAQ/archive but I can't find it! If I have a dynamically generated external URL available in the request/session object, e.g. http://www.banana.com;, how do I write a html:link href tag such that the link takes the user to that external URL? (Without using scriptlets?) I effectively want to do: html:link href=bean:write name=abcd property =xyz/ bean:write name=abcd property=xyz/ /html:link but can't do nested tags. How do I dynamically populate the content of the href attribute? Help please! Thanks Rob Breeds -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: html:link href to external URL in a
You can do this by just coding the link in with an HTML anchor tag as folows: a href=bean:write name=abcd property =xyz/ bean:write name=abcd property=xyz/ /a or use an expression html:link href=%=abcd.getXyz()% bean:write name=abcd property=xyz/ /html:link -Original Message- From: Rob Breeds [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 11:03 AM To: Struts Users Mailing List Subject: html:link href to external URL in a Hi This may be in the FAQ/archive but I can't find it! If I have a dynamically generated external URL available in the request/session object, e.g. http://www.banana.com;, how do I write a html:link href tag such that the link takes the user to that external URL? (Without using scriptlets?) I effectively want to do: html:link href=bean:write name=abcd property =xyz/ bean:write name=abcd property=xyz/ /html:link but can't do nested tags. How do I dynamically populate the content of the href attribute? Help please! Thanks Rob Breeds -- 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: html:link href to external URL in a
No way to do this with purely Struts tags? Thanks Rob Breeds Siggelkow, Bill bill.siggelkow@m To: 'Struts Users Mailing List' [EMAIL PROTECTED] irant.com cc: Subject: RE: html:link href to external URL in a 05/12/2001 16:17 Please respond to Struts Users Mailing List You can do this by just coding the link in with an HTML anchor tag as folows: a href=bean:write name=abcd property =xyz/ bean:write name=abcd property=xyz/ /a or use an expression html:link href=%=abcd.getXyz()% bean:write name=abcd property=xyz/ /html:link -Original Message- From: Rob Breeds [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 11:03 AM To: Struts Users Mailing List Subject: html:link href to external URL in a Hi This may be in the FAQ/archive but I can't find it! If I have a dynamically generated external URL available in the request/session object, e.g. http://www.banana.com;, how do I write a html:link href tag such that the link takes the user to that external URL? (Without using scriptlets?) I effectively want to do: html:link href=bean:write name=abcd property =xyz/ bean:write name=abcd property=xyz/ /html:link but can't do nested tags. How do I dynamically populate the content of the href attribute? Help please! Thanks Rob Breeds -- 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: inconsistency between html:link href=... and html:form action=...
John, My apologies - I did not express myself clearly in the first email. I would like to provide GLOBAL FORWARD, not ACTION NAME in html:form action=... field. The real reason I am bringing this question up is the Use Global Forwards for all entry points to applications Struts pattern described by Ted Husted at http://husted.com/about/scaffolding/catalog.htm. I am trying to stick to that pattern and use only global forwards on my JSP pages. Am I on the right track? Can anyone share their preferred way of using forwards vs. actions on JSP pages and within actions themselves? Maybe I misunderstood what you said... The action path specified in html:form action=.. is already a logical path which is defined in action path=.. in the struts-config.xml. According to documentation, html:link href=... takes either a name of a global forward, an arbitrary href, or a context-rooted page URL. On the other hand, html:form action=... only allows one type: a URL to which the form should be submitted. Is it unreasonable to expect somewhat consistent behavior between the two? I would love to specify a global action name as form action field. That way my JSP pages NEVER reference physical locations but logical action names only. -- Fyodor Golos ResGen, Invitrogen Corporation 2130 Memorial Pkwy, SW Huntsville, AL 35801 Phone: 800-533-4363 Direct: 256-327-4297 Fax: 256-536-9016 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
inconsistency between html:link href=... and html:form action=...
According to documentation, html:link href=... takes either a name of a global forward, an arbitrary href, or a context-rooted page URL. On the other hand, html:form action=... only allows one type: a URL to which the form should be submitted. Is it unreasonable to expect somewhat consistent behavior between the two? I would love to specify a global action name as form action field. That way my JSP pages NEVER reference physical locations but logical action names only. -- Fyodor Golos ResGen, Invitrogen Corporation 2130 Memorial Pkwy, SW Huntsville, AL 35801 Phone: 800-533-4363 Direct: 256-327-4297 Fax: 256-536-9016 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: inconsistency between html:link href=... and html:form action=...
Fyodor, Maybe I misunderstood what you said... The action path specified in html:form action=.. is already a logical path which is defined in action path=.. in the struts-config.xml. At 05:29 pm 12-11-2001 -0600, you wrote: According to documentation, html:link href=... takes either a name of a global forward, an arbitrary href, or a context-rooted page URL. On the other hand, html:form action=... only allows one type: a URL to which the form should be submitted. Is it unreasonable to expect somewhat consistent behavior between the two? I would love to specify a global action name as form action field. That way my JSP pages NEVER reference physical locations but logical action names only. -- Fyodor Golos ResGen, Invitrogen Corporation 2130 Memorial Pkwy, SW Huntsville, AL 35801 Phone: 800-533-4363 Direct: 256-327-4297 Fax: 256-536-9016 -- John Yu Scioworks Technologies e: [EMAIL PROTECTED] w: +(65) 873 5989 w: http://www.scioworks.com m: +(65) 9782 9610 Scioworks Camino - Rapid WebApp Assembly for Struts -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Reaching Action class from Href Link
Hi, U can use the link some like this. html:link href="/actionfromservletconfig.do?name=value" click here /html:link to replace the html form. enjoy bala
Linking HREF with Action
Hi all, I just wanted to know if it's possible to define an Action in the Struts config XML file that would be called from an HTML link (html:link tag) that IS NOT within a form ? I tried but it seems that the framework needs an ActionForm bean associated with each Action. Any idea, comments ? Thanks for your help. NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar... Une gamme d'outils gratuits et performants à votre service. Web/Wap : www.netcourrier.com Téléphone/Fax : 08 92 69 00 21 (0,34 E TTC/min - 2,21 F TTC/min) Minitel: 3615 NETCOURRIER (0,15 E TTC/min - 1,00 F TTC/min)
Re: Linking HREF with Action
Hello Olivier, Thursday, August 16, 2001, 10:44:54 AM, you wrote: OH Hi all, OH I just wanted to know if it's possible to define an Action in the Struts config XML file that would be called from an HTML link (html:link tag) that IS NOT within a form ? OH I tried but it seems that the framework needs an ActionForm bean associated with each Action. OH Any idea, comments ? If you are not define form for some action then reference to ActionForm in perform() method for this action will be null. And you can use html:link in any place of the JSP, not only in forms. -- Best regards, Olegmailto:[EMAIL PROTECTED]
RE: Linking HREF with Action
Is it not possible to not use a form at all? Section 1.3 of the user guide says: At a minimum, a mapping must specify (1) a request path and (2) the object type to act upon the request.. However when I try leaving off the form name in config file, and in html:form tag, I get an error. I can obviously get around it by just using the regular html form tag, but would like to keep everything consistant (the reason I don't need a form, is that my action creates performs a download). Cheers for any help, Dave Dudley Butt@i-Commerce Dudley.Butt%za.didata.com on 08/16/2001 02:53:48 AM Please respond to [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] cc:(bcc: David Hay/Lex/Lexmark) Subject: RE: Linking HREF with Action In that case you can just use any old actionformobject and asssociate it, what you will then use out of the mapping in the config file is only the action, and just ignore the actionform. actionpath=/logon type=com.didata.itax.payment.web.action.LoginAction name=any dummy actionform scope=request input=/logon.jsp forward name=failure path=/index.html/ forward name=success path=/login.jsp/ forward name=loggedOut path=/logon.jsp / forward name=buildLeftFrame path=/leftframe.html redirect=true / forward name=changePassword path=/loginForceChangePassword.jsp/ /action -Original Message- From: Olivier Houyoux [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 16, 2001 8:45 AM To: [EMAIL PROTECTED] Subject: Linking HREF with Action Hi all, I just wanted to know if it's possible to define an Action in the Struts config XML file that would be called from an HTML link (html:link tag) that IS NOT within a form ? I tried but it seems that the framework needs an ActionForm bean associated with each Action. Any idea, comments ? Thanks for your help. NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar... Une gamme d'outils gratuits et performants à votre service. Web/Wap : www.netcourrier.com Téléphone/Fax : 08 92 69 00 21 (0,34 E TTC/min - 2,21 F TTC/min) Minitel: 3615 NETCOURRIER (0,15 E TTC/min - 1,00 F TTC/min) ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
RE: Reaching Action class from Href Link
I'm using Tomcat.don't know if it'll work using something else. Maybe if you show some of your code I can help. -Original Message- From: Greg Maletic [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 1:59 PM To: [EMAIL PROTECTED] Subject: RE: Reaching Action class from Href Link It's not working for me, for some reason. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg]On Behalf Of Fletcher, Ken Sent: Friday, August 03, 2001 11:41 AM To: '[EMAIL PROTECTED]' Subject: RE: Reaching Action class from Href Link html:link href=SomeAction.do/html:link does work, as long as you have the .do in there (did for me, anyway). -Original Message- From: John M. Corro [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 3:33 PM To: [EMAIL PROTECTED] Subject: Re: Reaching Action class from Href Link Thanks to John and Ken for the assistance. Point of clarification other interested newbies, using a form's 'action' value as the link's 'href' value will not work - the reason mine wasn't working. For instance, form action=SomeAction may work, where as a href=SomeAction~~~/a or html:link href=SomeAction~~~/html:link will not. - Original Message - From: John Schroeder [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 03, 2001 11:22 AM Subject: RE: Reaching Action class from Href Link Using the struts html:form tag will set the method to POST by default. This won't prevent you from using the link as you describe though. The service methods of an HttpServlet doPost() and doGet() will accomplish essentially the same goal (often doGet() will just call doPost() ). In the case of the struts ActionServlet, both of these methods call process(). So you can use a query string to pass your parameters (or extra path info if you wish). So, that was a little long-winded way of saying that your link can look like: a href=/someContext/someAction.do?param1=fooparam2=barparam3=bazLINK TEXT/a Hope this helps!! --John -Original Message- From: John M. Corro [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 1:07 PM To: [EMAIL PROTECTED] Subject: Reaching Action class from Href Link I've recently begun working with Struts and am looking to create a scenario where a user can click on a link and trigger some event in an Action class (ie the clicking of a link would be the same as clicking a form's submit button). My understanding is that within Struts forms submit by the post method by default so I don't know if the only way to reach an Action class is by an actual form. Any one have any insight?
RE: Reaching Action class from Href Link
I don't believe I can use this approach because my original JSP has many links that all lead to the EditProduct action, but each link specifies a different productId, corresponding to a different product. I need to wait until the user clicks on a specific product before I can populate the bean, and I need to have my action called to do this, which is the source of the problem. My action isn't being called at all--it's just going directly to the next JSP. After finding out that it wasn't calling my action class, my next question was: how does the ActionServlet know what JSP to go to? The answer is it's using the input tag on the editProduct action mapping, and jumping directly to that. The Struts docs imply that input is only used when a ActionForm.validate() method returns ActionErrors, but apparently it's not true: it's being jumped to in lieu of calling my action. What have other people experienced when using the input tag? Thanks. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg]On Behalf Of Fletcher, Ken Sent: Friday, August 03, 2001 12:32 PM To: '[EMAIL PROTECTED]' Subject: RE: Reaching Action class from Href Link I haven't played around with paramID, paramName and paramProperty in the tag yet (still experimenting). However, I have been able to get the bean to show up on the forwarded JSP by putting it in the HttpSession (from the action class) and then have the JSP access the properties in regular fashion: jsp:useBean id=info class=logon.InfoForm scope=session / jsp:getProperty name=info property=someInfo / Does anyone else have a more elegant solution to this? -Original Message- From: Greg Maletic [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 2:13 PM To: [EMAIL PROTECTED] Subject: RE: Reaching Action class from Href Link In my JSP, I've got: html:link href=editProduct.do paramId=productId paramName=product paramProperty=ID iMy link goes here/i /html:link In my struts-config.xml file, I've got: ... form-bean name=productForm type=com.zerog.u2d.web.struts.product.ProductForm/ ... action path=/editProduct type=com.zerog.u2d.web.struts.product.EditProduct name=productForm input=/devportal/template.jsp?page=PRODUCT validate=true forward name=next path=/devportal/template.jsp?page=PRODUCT/ /action What I'm finding is that my EditProduct action isn't being called at all. I'm wanting EditProduct in this case to prepopulate the form bean with data so it will display for editing on the next JSP. Because of this problem, no data is being written into the form bean, so my form comes up blank when I want it to be pre-filled with data. Any help is greatly appreciated! --Greg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg]On Behalf Of Fletcher, Ken Sent: Friday, August 03, 2001 12:07 PM To: '[EMAIL PROTECTED]' Subject: RE: Reaching Action class from Href Link I'm using Tomcat.don't know if it'll work using something else. Maybe if you show some of your code I can help. -Original Message- From: Greg Maletic [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 1:59 PM To: [EMAIL PROTECTED] Subject: RE: Reaching Action class from Href Link It's not working for me, for some reason. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg]On Behalf Of Fletcher, Ken Sent: Friday, August 03, 2001 11:41 AM To: '[EMAIL PROTECTED]' Subject: RE: Reaching Action class from Href Link html:link href=SomeAction.do/html:link does work, as long as you have the .do in there (did for me, anyway). -Original Message- From: John M. Corro [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 3:33 PM To: [EMAIL PROTECTED] Subject: Re: Reaching Action class from Href Link Thanks to John and Ken for the assistance. Point of clarification other interested newbies, using a form's 'action' value as the link's 'href' value will not work - the reason mine wasn't working. For instance, form action=SomeAction may work, where as a href=SomeAction~~~/a or html:link href=SomeAction~~~/html:link will not. - Original Message - From: John Schroeder [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 03, 2001 11:22 AM Subject: RE: Reaching Action class from Href Link Using the struts html:form tag will set the method to POST by default. This won't prevent you from using the link as you describe though. The service methods of an HttpServlet doPost() and doGet() will accomplish essentially the same goal (often doGet() will just call doPost() ). In the case of the struts ActionServlet, both of these methods call process(). So you can use a query string to pass your parameters (or extra path info if you wish). So, that was a little long-winded way of saying that your link can look like: a href=/someContext/someAction.do?param1=fooparam2=barparam3=bazLINK TEXT/a Hope
RE: Reaching Action class from Href Link
Now I'm really confused! Your original problem was that you wanted to have a link forward to an action. Your clarification shows how to do it from a form (form action=SomeAction), but then you say that using a link or href will not work. That doesn't seem to solve your original problem, does it? Please let me know what I'm missing here, because I'm having this problem as well. Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg]On Behalf Of John M. Corro Sent: Friday, August 03, 2001 1:33 PM To: [EMAIL PROTECTED] Subject: Re: Reaching Action class from Href Link Thanks to John and Ken for the assistance. Point of clarification other interested newbies, using a form's 'action' value as the link's 'href' value will not work - the reason mine wasn't working. For instance, form action=SomeAction may work, where as a href=SomeAction~~~/a or html:link href=SomeAction~~~/html:link will not. - Original Message - From: John Schroeder [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 03, 2001 11:22 AM Subject: RE: Reaching Action class from Href Link Using the struts html:form tag will set the method to POST by default. This won't prevent you from using the link as you describe though. The service methods of an HttpServlet doPost() and doGet() will accomplish essentially the same goal (often doGet() will just call doPost() ). In the case of the struts ActionServlet, both of these methods call process(). So you can use a query string to pass your parameters (or extra path info if you wish). So, that was a little long-winded way of saying that your link can look like: a href=/someContext/someAction.do?param1=fooparam2=barparam3=bazLINK TEXT/a Hope this helps!! --John -Original Message- From: John M. Corro [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 1:07 PM To: [EMAIL PROTECTED] Subject: Reaching Action class from Href Link I've recently begun working with Struts and am looking to create a scenario where a user can click on a link and trigger some event in an Action class (ie the clicking of a link would be the same as clicking a form's submit button). My understanding is that within Struts forms submit by the post method by default so I don't know if the only way to reach an Action class is by an actual form. Any one have any insight?
Re: Reaching Action class from Href Link
If you use the Struts html:form tag, the value of the 'action' attribute is used to look up the corresponding action mapping, and Struts will append the .do if you are using extension mapping for your servlet. If you use the Struts html:link tag with the 'href' attribute, then that value is taken literally. You have a bit more flexibility if you use the 'forward' or 'page' attributes with this tag. -- Martin Cooper At 01:32 PM 8/3/01, John M. Corro wrote: Thanks to John and Ken for the assistance. Point of clarification other interested newbies, using a form's 'action' value as the link's 'href' value will not work - the reason mine wasn't working. For instance, form action=SomeAction may work, where as a href=SomeAction~~~/a or html:link href=SomeAction~~~/html:link will not. - Original Message - From: John Schroeder [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 03, 2001 11:22 AM Subject: RE: Reaching Action class from Href Link Using the struts html:form tag will set the method to POST by default. This won't prevent you from using the link as you describe though. The service methods of an HttpServlet doPost() and doGet() will accomplish essentially the same goal (often doGet() will just call doPost() ). In the case of the struts ActionServlet, both of these methods call process(). So you can use a query string to pass your parameters (or extra path info if you wish). So, that was a little long-winded way of saying that your link can look like: a href=/someContext/someAction.do?param1=fooparam2=barparam3=bazLINK TEXT/a Hope this helps!! --John -Original Message- From: John M. Corro [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 1:07 PM To: [EMAIL PROTECTED] Subject: Reaching Action class from Href Link I've recently begun working with Struts and am looking to create a scenario where a user can click on a link and trigger some event in an Action class (ie the clicking of a link would be the same as clicking a form's submit button). My understanding is that within Struts forms submit by the post method by default so I don't know if the only way to reach an Action class is by an actual form. Any one have any insight?
Re: Reaching Action class from Href Link
Yes, that's correct. Using extension mapping with Struts, and .do in particular, is just a Struts convention. I suspect that most people are probably following that convention, but it is not a requirement. You are free to use a different extension, such as .act or .cmd or whatever, or to use path mapping, if you want. As you point out, changing the mapping method or the extension after the project is in development may have repercussions, so it's a decision you really want to make up front, and stick with. -- Martin Cooper At 02:09 PM 8/3/01, John M. Corro wrote: Ken clarified my point - that in a form's 'action' you don't need to tack the '.do' extension to the end of the action mapping (ie action=SomeAction). In a link's 'href' value you do need to tack on the 'do' extension (ie the value changes to href=SomeAction.do). I believe this comes w/ a caveat as the '.do' extension can be changed. By default the extension is '.do' in the web.xml file. I haven't tried this, but I would imagine if you changed the extension in the web.xml file, you'd have to also reflect the change in your links. - Original Message - From: Greg Maletic [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 03, 2001 11:57 AM Subject: RE: Reaching Action class from Href Link Now I'm really confused! Your original problem was that you wanted to have a link forward to an action. Your clarification shows how to do it from a form (form action=SomeAction), but then you say that using a link or href will not work. That doesn't seem to solve your original problem, does it? Please let me know what I'm missing here, because I'm having this problem as well. Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg]On Behalf Of John M. Corro Sent: Friday, August 03, 2001 1:33 PM To: [EMAIL PROTECTED] Subject: Re: Reaching Action class from Href Link Thanks to John and Ken for the assistance. Point of clarification other interested newbies, using a form's 'action' value as the link's 'href' value will not work - the reason mine wasn't working. For instance, form action=SomeAction may work, where as a href=SomeAction~~~/a or html:link href=SomeAction~~~/html:link will not. - Original Message - From: John Schroeder [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 03, 2001 11:22 AM Subject: RE: Reaching Action class from Href Link Using the struts html:form tag will set the method to POST by default. This won't prevent you from using the link as you describe though. The service methods of an HttpServlet doPost() and doGet() will accomplish essentially the same goal (often doGet() will just call doPost() ). In the case of the struts ActionServlet, both of these methods call process(). So you can use a query string to pass your parameters (or extra path info if you wish). So, that was a little long-winded way of saying that your link can look like: a href=/someContext/someAction.do?param1=fooparam2=barparam3=bazLINK TEXT/a Hope this helps!! --John -Original Message- From: John M. Corro [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 1:07 PM To: [EMAIL PROTECTED] Subject: Reaching Action class from Href Link I've recently begun working with Struts and am looking to create a scenario where a user can click on a link and trigger some event in an Action class (ie the clicking of a link would be the same as clicking a form's submit button). My understanding is that within Struts forms submit by the post method by default so I don't know if the only way to reach an Action class is by an actual form. Any one have any insight?
RE: Reaching Action class from Href Link
jsp:useBean id=info class=logon.InfoForm scope=session / bean:write name=info property=moreInfo/ In addition, If you set the variables from your bean into an ActionForm you won't even have to use the jsp:useBean neither. -Original Message- From: Fletcher, Ken [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 2:32 PM To: '[EMAIL PROTECTED]' Subject: RE: Reaching Action class from Href Link I haven't played around with paramID, paramName and paramProperty in the tag yet (still experimenting). However, I have been able to get the bean to show up on the forwarded JSP by putting it in the HttpSession (from the action class) and then have the JSP access the properties in regular fashion: jsp:useBean id=info class=logon.InfoForm scope=session / jsp:getProperty name=info property=someInfo / Does anyone else have a more elegant solution to this? -Original Message- From: Greg Maletic [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 2:13 PM To: [EMAIL PROTECTED] Subject: RE: Reaching Action class from Href Link In my JSP, I've got: html:link href=editProduct.do paramId=productId paramName=product paramProperty=ID iMy link goes here/i /html:link In my struts-config.xml file, I've got: ... form-bean name=productForm type=com.zerog.u2d.web.struts.product.ProductForm/ ... action path=/editProduct type=com.zerog.u2d.web.struts.product.EditProduct name=productForm input=/devportal/template.jsp?page=PRODUCT validate=true forward name=next path=/devportal/template.jsp?page=PRODUCT/ /action What I'm finding is that my EditProduct action isn't being called at all. I'm wanting EditProduct in this case to prepopulate the form bean with data so it will display for editing on the next JSP. Because of this problem, no data is being written into the form bean, so my form comes up blank when I want it to be pre-filled with data. Any help is greatly appreciated! --Greg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg]On Behalf Of Fletcher, Ken Sent: Friday, August 03, 2001 12:07 PM To: '[EMAIL PROTECTED]' Subject: RE: Reaching Action class from Href Link I'm using Tomcat.don't know if it'll work using something else. Maybe if you show some of your code I can help. -Original Message- From: Greg Maletic [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 1:59 PM To: [EMAIL PROTECTED] Subject: RE: Reaching Action class from Href Link It's not working for me, for some reason. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg]On Behalf Of Fletcher, Ken Sent: Friday, August 03, 2001 11:41 AM To: '[EMAIL PROTECTED]' Subject: RE: Reaching Action class from Href Link html:link href=SomeAction.do/html:link does work, as long as you have the .do in there (did for me, anyway). -Original Message- From: John M. Corro [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 3:33 PM To: [EMAIL PROTECTED] Subject: Re: Reaching Action class from Href Link Thanks to John and Ken for the assistance. Point of clarification other interested newbies, using a form's 'action' value as the link's 'href' value will not work - the reason mine wasn't working. For instance, form action=SomeAction may work, where as a href=SomeAction~~~/a or html:link href=SomeAction~~~/html:link will not. - Original Message - From: John Schroeder [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 03, 2001 11:22 AM Subject: RE: Reaching Action class from Href Link Using the struts html:form tag will set the method to POST by default. This won't prevent you from using the link as you describe though. The service methods of an HttpServlet doPost() and doGet() will accomplish essentially the same goal (often doGet() will just call doPost() ). In the case of the struts ActionServlet, both of these methods call process(). So you can use a query string to pass your parameters (or extra path info if you wish). So, that was a little long-winded way of saying that your link can look like: a href=/someContext/someAction.do?param1=fooparam2=barparam3=bazLINK TEXT/a Hope this helps!! --John -Original Message- From: John M. Corro [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 1:07 PM To: [EMAIL PROTECTED] Subject: Reaching Action class from Href Link I've recently begun working with Struts and am looking to create a scenario where a user can click on a link and trigger some event in an Action class (ie the clicking of a link would be the same as clicking a form's submit button). My understanding is that within Struts forms submit by the post method by default so I don't know if the only way to reach an Action class is by an actual form. Any one have any insight?
RE: Reaching Action class from Href Link
I tried unsuccessfully to do that. Maybe I missed something - do you still have to add the bean to the HttpSession? -Original Message- From: Gus Delgado [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 2:41 PM To: [EMAIL PROTECTED] Subject: RE: Reaching Action class from Href Link jsp:useBean id=info class=logon.InfoForm scope=session / bean:write name=info property=moreInfo/ In addition, If you set the variables from your bean into an ActionForm you won't even have to use the jsp:useBean neither. -Original Message- From: Fletcher, Ken [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 2:32 PM To: '[EMAIL PROTECTED]' Subject: RE: Reaching Action class from Href Link I haven't played around with paramID, paramName and paramProperty in the tag yet (still experimenting). However, I have been able to get the bean to show up on the forwarded JSP by putting it in the HttpSession (from the action class) and then have the JSP access the properties in regular fashion: jsp:useBean id=info class=logon.InfoForm scope=session / jsp:getProperty name=info property=someInfo / Does anyone else have a more elegant solution to this? -Original Message- From: Greg Maletic [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 2:13 PM To: [EMAIL PROTECTED] Subject: RE: Reaching Action class from Href Link In my JSP, I've got: html:link href=editProduct.do paramId=productId paramName=product paramProperty=ID iMy link goes here/i /html:link In my struts-config.xml file, I've got: ... form-bean name=productForm type=com.zerog.u2d.web.struts.product.ProductForm/ ... action path=/editProduct type=com.zerog.u2d.web.struts.product.EditProduct name=productForm input=/devportal/template.jsp?page=PRODUCT validate=true forward name=next path=/devportal/template.jsp?page=PRODUCT/ /action What I'm finding is that my EditProduct action isn't being called at all. I'm wanting EditProduct in this case to prepopulate the form bean with data so it will display for editing on the next JSP. Because of this problem, no data is being written into the form bean, so my form comes up blank when I want it to be pre-filled with data. Any help is greatly appreciated! --Greg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg]On Behalf Of Fletcher, Ken Sent: Friday, August 03, 2001 12:07 PM To: '[EMAIL PROTECTED]' Subject: RE: Reaching Action class from Href Link I'm using Tomcat.don't know if it'll work using something else. Maybe if you show some of your code I can help. -Original Message- From: Greg Maletic [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 1:59 PM To: [EMAIL PROTECTED] Subject: RE: Reaching Action class from Href Link It's not working for me, for some reason. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg]On Behalf Of Fletcher, Ken Sent: Friday, August 03, 2001 11:41 AM To: '[EMAIL PROTECTED]' Subject: RE: Reaching Action class from Href Link html:link href=SomeAction.do/html:link does work, as long as you have the .do in there (did for me, anyway). -Original Message- From: John M. Corro [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 3:33 PM To: [EMAIL PROTECTED] Subject: Re: Reaching Action class from Href Link Thanks to John and Ken for the assistance. Point of clarification other interested newbies, using a form's 'action' value as the link's 'href' value will not work - the reason mine wasn't working. For instance, form action=SomeAction may work, where as a href=SomeAction~~~/a or html:link href=SomeAction~~~/html:link will not. - Original Message - From: John Schroeder [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 03, 2001 11:22 AM Subject: RE: Reaching Action class from Href Link Using the struts html:form tag will set the method to POST by default. This won't prevent you from using the link as you describe though. The service methods of an HttpServlet doPost() and doGet() will accomplish essentially the same goal (often doGet() will just call doPost() ). In the case of the struts ActionServlet, both of these methods call process(). So you can use a query string to pass your parameters (or extra path info if you wish). So, that was a little long-winded way of saying that your link can look like: a href=/someContext/someAction.do?param1=fooparam2=barparam3=bazLINK TEXT/a Hope this helps!! --John -Original Message- From: John M. Corro [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 1:07 PM To: [EMAIL PROTECTED] Subject: Reaching Action class from Href Link I've recently begun working with Struts and am looking to create a scenario where a user can click on a link and trigger some event in an Action class (ie the clicking of a link would be the same as clicking a form's submit button). My
RE: Reaching Action class from Href Link
I haven't played around with paramID, paramName and paramProperty in the tag yet (still experimenting). However, I have been able to get the bean to show up on the forwarded JSP by putting it in the HttpSession (from the action class) and then have the JSP access the properties in regular fashion: jsp:useBean id=info class=logon.InfoForm scope=session / jsp:getProperty name=info property=someInfo / Does anyone else have a more elegant solution to this? -Original Message- From: Greg Maletic [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 2:13 PM To: [EMAIL PROTECTED] Subject: RE: Reaching Action class from Href Link In my JSP, I've got: html:link href=editProduct.do paramId=productId paramName=product paramProperty=ID iMy link goes here/i /html:link In my struts-config.xml file, I've got: ... form-bean name=productForm type=com.zerog.u2d.web.struts.product.ProductForm/ ... action path=/editProduct type=com.zerog.u2d.web.struts.product.EditProduct name=productForm input=/devportal/template.jsp?page=PRODUCT validate=true forward name=next path=/devportal/template.jsp?page=PRODUCT/ /action What I'm finding is that my EditProduct action isn't being called at all. I'm wanting EditProduct in this case to prepopulate the form bean with data so it will display for editing on the next JSP. Because of this problem, no data is being written into the form bean, so my form comes up blank when I want it to be pre-filled with data. Any help is greatly appreciated! --Greg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg]On Behalf Of Fletcher, Ken Sent: Friday, August 03, 2001 12:07 PM To: '[EMAIL PROTECTED]' Subject: RE: Reaching Action class from Href Link I'm using Tomcat.don't know if it'll work using something else. Maybe if you show some of your code I can help. -Original Message- From: Greg Maletic [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 1:59 PM To: [EMAIL PROTECTED] Subject: RE: Reaching Action class from Href Link It's not working for me, for some reason. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg]On Behalf Of Fletcher, Ken Sent: Friday, August 03, 2001 11:41 AM To: '[EMAIL PROTECTED]' Subject: RE: Reaching Action class from Href Link html:link href=SomeAction.do/html:link does work, as long as you have the .do in there (did for me, anyway). -Original Message- From: John M. Corro [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 3:33 PM To: [EMAIL PROTECTED] Subject: Re: Reaching Action class from Href Link Thanks to John and Ken for the assistance. Point of clarification other interested newbies, using a form's 'action' value as the link's 'href' value will not work - the reason mine wasn't working. For instance, form action=SomeAction may work, where as a href=SomeAction~~~/a or html:link href=SomeAction~~~/html:link will not. - Original Message - From: John Schroeder [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 03, 2001 11:22 AM Subject: RE: Reaching Action class from Href Link Using the struts html:form tag will set the method to POST by default. This won't prevent you from using the link as you describe though. The service methods of an HttpServlet doPost() and doGet() will accomplish essentially the same goal (often doGet() will just call doPost() ). In the case of the struts ActionServlet, both of these methods call process(). So you can use a query string to pass your parameters (or extra path info if you wish). So, that was a little long-winded way of saying that your link can look like: a href=/someContext/someAction.do?param1=fooparam2=barparam3=bazLINK TEXT/a Hope this helps!! --John -Original Message- From: John M. Corro [mailto:[EMAIL PROTECTED]] Sent: Friday, August 03, 2001 1:07 PM To: [EMAIL PROTECTED] Subject: Reaching Action class from Href Link I've recently begun working with Struts and am looking to create a scenario where a user can click on a link and trigger some event in an Action class (ie the clicking of a link would be the same as clicking a form's submit button). My understanding is that within Struts forms submit by the post method by default so I don't know if the only way to reach an Action class is by an actual form. Any one have any insight?
Reaching Action class from Href Link
I've recently begun working with Struts and am looking to create a scenario where a user can click on a link and trigger some event in an Action class (ie the clicking of a link would be the same as clicking a form's submit button). My understanding is that within Struts forms submit by the post method by default so I don't know if the only way to reach an Action class is by an actual form. Any one have any insight?
Re: HREF link question - oops!
Sorry about the last message. It didn't work due to a spelling mistake on my part. The html:link tag seems to work as expected. Thanks again, Rick At 02:18 PM 6/14/01 -0700, you wrote: Hi Craig, Thanks for your response. Unfortunately, it still doesn't work. I tried two different approaches: with the html:base/ tag and without it, and I get the same result in both cases: I code the following link: html:link page=/jsp/prodinfo/prodinfo.jspIntroduction/html:link The html source (in the browser, Netscape 4.6.1 or IE 4.72) shows: When I use the html:base/ tag: base href=http://localhost:8080/backup/jsp/prodinfo/prod-info.jsp; in the HTML head section, and The link is generated as: a href=/backup/jsp/prodinfo/prodinfo.jspIntroduction/aas the href link When I mouse over the link in the browser, the status line at the bottom of the browser window displays: http://localhost:8080/backup/jsp/prodinfo/prod-info.jsp When I click the link, I get the following in the browser window: Not Found (404) Original request: /backup/jsp/prodinfo/prodinfo.jsp Not found request: /backup/jsp/prodinfo/prodinfo.jsp Am I doing something wrong? Must be, since you use this approach all the time. Thanks again for your help. It is greatly appreciated. Rick Horowitz At 09:59 AM 6/14/01 -0700, you wrote: On Wed, 13 Jun 2001, Rick Horowitz wrote: Hi, I'm trying to use href links with Struts templates, and can't figure out how to make my href links work properly. [Templates seem to work just fine, otherwise.]... my compliments. 1. I want to use Struts html:link tags so that to automatically do URL session encoding. Struts does this automatically for you. 2. I want to use absolute URLs to make coding of urls more robust. For example, if I have a directory structure of JSPs: jsp jsp/prodinfo jsp/faq ...I want to be able to code the url something like... jsp/faq/faq1.jsp or jsp/prodinfo/info1.jsp, in case I change the directory structure, rather than using relative links, e.g. ../faq/faq1.jsp. I have found it best to use context-relative URLs starting with a / character throughout my applications, rather than trying to use relative links -- for the reasons that you are probably familiar with. To do that for links, use the page attribute to specify the destination -- Struts will prepend the context path of the current application for you, so that the browser always goes the right place. For example, you might code: html:link page=/jsp/faq/faq1.jspTo the FAQ/html:link 3. For the portion of the website that I'm currently working on, I am creating href links from one JSP to other JSPs. [For other portions of the website, I will be using an MVC architecture, hence forwarding from a servlet to a JSP and vice versa.] It works either way, but remember that links directly from one page to another bypasses the controller -- and therefore bypasses the stuff that the controller servlet does for you. 4. I have tried various approaches to using the html:base/ tag in the HTML HEAD section of my Struts template file, not using a base tag, and have tried using the following to set the html base: BASE HREF=%= http://; +request.getServerName() +: +request.getServerPort() +request.getContextPath() %/ Although the latter works with regular a href tags, it does not seem to work with html:link Struts tags. See the html:base/ tag for a way to do this automatically. However, whether you create it yourself or not, the base element affects only relative hyperlinks. If you follow my suggestion above (always use context-relative links), you won't need it. I have tried a variety of combinations of these base tags with a variety of combinations of url encodings, but cannot seem to get them to work -- except with regular a href tags using the BASE HREF=%= http://; +request.getServerName() +: +request.getServerPort() +request.getContextPath() %/ base tag setting. Thank you in advance to anyone who can help, Rick Horowitz Craig Rick Horowitz Rick Horowitz
HREF link question
Hi, I'm trying to use href links with Struts templates, and can't figure out how to make my href links work properly. [Templates seem to work just fine, otherwise.]... my compliments. 1. I want to use Struts html:link tags so that to automatically do URL session encoding. 2. I want to use absolute URLs to make coding of urls more robust. For example, if I have a directory structure of JSPs: jsp jsp/prodinfo jsp/faq ...I want to be able to code the url something like... jsp/faq/faq1.jsp or jsp/prodinfo/info1.jsp, in case I change the directory structure, rather than using relative links, e.g. ../faq/faq1.jsp. 3. For the portion of the website that I'm currently working on, I am creating href links from one JSP to other JSPs. [For other portions of the website, I will be using an MVC architecture, hence forwarding from a servlet to a JSP and vice versa.] 4. I have tried various approaches to using the html:base/ tag in the HTML HEAD section of my Struts template file, not using a base tag, and have tried using the following to set the html base: BASE HREF=%= http://; +request.getServerName() +: +request.getServerPort() +request.getContextPath() %/ Although the latter works with regular a href tags, it does not seem to work with html:link Struts tags. I have tried a variety of combinations of these base tags with a variety of combinations of url encodings, but cannot seem to get them to work -- except with regular a href tags using the BASE HREF=%= http://; +request.getServerName() +: +request.getServerPort() +request.getContextPath() %/ base tag setting. Thank you in advance to anyone who can help, Rick Horowitz
Re: HREF link question
On Wed, 13 Jun 2001, Rick Horowitz wrote: Hi, I'm trying to use href links with Struts templates, and can't figure out how to make my href links work properly. [Templates seem to work just fine, otherwise.]... my compliments. 1. I want to use Struts html:link tags so that to automatically do URL session encoding. Struts does this automatically for you. 2. I want to use absolute URLs to make coding of urls more robust. For example, if I have a directory structure of JSPs: jsp jsp/prodinfo jsp/faq ...I want to be able to code the url something like... jsp/faq/faq1.jsp or jsp/prodinfo/info1.jsp, in case I change the directory structure, rather than using relative links, e.g. ../faq/faq1.jsp. I have found it best to use context-relative URLs starting with a / character throughout my applications, rather than trying to use relative links -- for the reasons that you are probably familiar with. To do that for links, use the page attribute to specify the destination -- Struts will prepend the context path of the current application for you, so that the browser always goes the right place. For example, you might code: html:link page=/jsp/faq/faq1.jspTo the FAQ/html:link 3. For the portion of the website that I'm currently working on, I am creating href links from one JSP to other JSPs. [For other portions of the website, I will be using an MVC architecture, hence forwarding from a servlet to a JSP and vice versa.] It works either way, but remember that links directly from one page to another bypasses the controller -- and therefore bypasses the stuff that the controller servlet does for you. 4. I have tried various approaches to using the html:base/ tag in the HTML HEAD section of my Struts template file, not using a base tag, and have tried using the following to set the html base: BASE HREF=%= http://; +request.getServerName() +: +request.getServerPort() +request.getContextPath() %/ Although the latter works with regular a href tags, it does not seem to work with html:link Struts tags. See the html:base/ tag for a way to do this automatically. However, whether you create it yourself or not, the base element affects only relative hyperlinks. If you follow my suggestion above (always use context-relative links), you won't need it. I have tried a variety of combinations of these base tags with a variety of combinations of url encodings, but cannot seem to get them to work -- except with regular a href tags using the BASE HREF=%= http://; +request.getServerName() +: +request.getServerPort() +request.getContextPath() %/ base tag setting. Thank you in advance to anyone who can help, Rick Horowitz Craig
Re: HREF link question
Hi Craig, Thanks for your response. Unfortunately, it still doesn't work. I tried two different approaches: with the html:base/ tag and without it, and I get the same result in both cases: I code the following link: html:link page=/jsp/prodinfo/prodinfo.jspIntroduction/html:link The html source (in the browser, Netscape 4.6.1 or IE 4.72) shows: When I use the html:base/ tag: base href=http://localhost:8080/backup/jsp/prodinfo/prod-info.jsp; in the HTML head section, and The link is generated as: a href=/backup/jsp/prodinfo/prodinfo.jspIntroduction/aas the href link When I mouse over the link in the browser, the status line at the bottom of the browser window displays: http://localhost:8080/backup/jsp/prodinfo/prod-info.jsp When I click the link, I get the following in the browser window: Not Found (404) Original request: /backup/jsp/prodinfo/prodinfo.jsp Not found request: /backup/jsp/prodinfo/prodinfo.jsp Am I doing something wrong? Must be, since you use this approach all the time. Thanks again for your help. It is greatly appreciated. Rick Horowitz At 09:59 AM 6/14/01 -0700, you wrote: On Wed, 13 Jun 2001, Rick Horowitz wrote: Hi, I'm trying to use href links with Struts templates, and can't figure out how to make my href links work properly. [Templates seem to work just fine, otherwise.]... my compliments. 1. I want to use Struts html:link tags so that to automatically do URL session encoding. Struts does this automatically for you. 2. I want to use absolute URLs to make coding of urls more robust. For example, if I have a directory structure of JSPs: jsp jsp/prodinfo jsp/faq ...I want to be able to code the url something like... jsp/faq/faq1.jsp or jsp/prodinfo/info1.jsp, in case I change the directory structure, rather than using relative links, e.g. ../faq/faq1.jsp. I have found it best to use context-relative URLs starting with a / character throughout my applications, rather than trying to use relative links -- for the reasons that you are probably familiar with. To do that for links, use the page attribute to specify the destination -- Struts will prepend the context path of the current application for you, so that the browser always goes the right place. For example, you might code: html:link page=/jsp/faq/faq1.jspTo the FAQ/html:link 3. For the portion of the website that I'm currently working on, I am creating href links from one JSP to other JSPs. [For other portions of the website, I will be using an MVC architecture, hence forwarding from a servlet to a JSP and vice versa.] It works either way, but remember that links directly from one page to another bypasses the controller -- and therefore bypasses the stuff that the controller servlet does for you. 4. I have tried various approaches to using the html:base/ tag in the HTML HEAD section of my Struts template file, not using a base tag, and have tried using the following to set the html base: BASE HREF=%= http://; +request.getServerName() +: +request.getServerPort() +request.getContextPath() %/ Although the latter works with regular a href tags, it does not seem to work with html:link Struts tags. See the html:base/ tag for a way to do this automatically. However, whether you create it yourself or not, the base element affects only relative hyperlinks. If you follow my suggestion above (always use context-relative links), you won't need it. I have tried a variety of combinations of these base tags with a variety of combinations of url encodings, but cannot seem to get them to work -- except with regular a href tags using the BASE HREF=%= http://; +request.getServerName() +: +request.getServerPort() +request.getContextPath() %/ base tag setting. Thank you in advance to anyone who can help, Rick Horowitz Craig Rick Horowitz