struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brice Ruth <br...@fiskars.com>
Subject Re: mapped address
Date Thu, 08 Jan 2004 18:45:04 GMT
I'm glad you like it :) I won't take credit for it, though - someone 
else on the list passed it along to me when I had similar issues!!

The <jsp:useBean> tag is standard in your JSP container, nothing needed 
for that. For the <c:set> tags, you'll need the JSTL core tag library. 
You can get this from any number of places, easiest is probably from the 
jakarta site, here:

http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html

Otávio Augusto wrote:

>Hmmm, that is realy very simple. As I am pretty new to struts: are these tags easyly recognized
or do I have to add some additional declaration?
>no matter what i have to add to make this work, I got the point and it is really simple.Reminds
me of Ant :)
>Thanks very much
>
>Otávio Augusto
>
>On Thu, 08 Jan 2004 11:34:23 -0600
>Brice Ruth <bruth@fiskars.com> wrote:
>
>  
>
>>Pretty easy.
>>
>><!-- assume "someELvalue" is "my2ndTopic" -->
>><jsp:useBean id="linkParams" class="java.util.HashMap"/>
>><c:set target="${linkParams}" property="topic" value="somevalue"/>
>><c:set target="${linkParams}" property="topic2" value="${someELvalue}"/>
>>
>><html:link action="/myAction" name="linkParams">my link</html:link>
>>
>>will yield:
>>
>><a href="/myAction.do?topic=somevalue&topic2=my2ndTopic">my link</a>
>>
>>Otávio Augusto wrote:
>>
>>    
>>
>>>Yeah, that is a nice idea. But I already have a parameter being sent by this link:
it is the id of a certain element. So, i have to add a second parameter. That is the case.
Adding two parameters is still confusing to me.
>>>
>>>thanks
>>>
>>>Otávio Augusto
>>>
>>>On Thu, 8 Jan 2004 10:14:21 -0700
>>>"Brian Barnett" <bbarnett@scholarinc.com> wrote:
>>>
>>> 
>>>
>>>      
>>>
>>>>Maybe you could add a URL parameter to the link on each of the three pages
identifying which page it is. Then in the action class, get the request object, get the URL
parameter from the request object, and based on the parameter, you should know where to return
to.
>>>>
>>>>
>>>>-----Original Message-----
>>>>From: Otávio Augusto [mailto:otavio.augusto@bol.com.br] 
>>>>Sent: Thursday, January 08, 2004 9:54 AM
>>>>To: Struts Users Mailing List
>>>>Subject: Re: mapped address
>>>>
>>>>Yeah,putting it in a hidden field is insecure (and impossible: it is not a
form, it is a simple link.). I'm trying to run away from the struts way to generate more than
one parameter, specialy inside a logic:iterate tag. I think having an Action class with many
methods each regarding to a an input page would help.
>>>>
>>>>Thanks for the help
>>>>
>>>>Otávio Augusto 
>>>>
>>>>On Thu, 8 Jan 2004 11:22:03 -0500 
>>>>"Yee, Richard K,,DMDCWEST" <Yeerk@osd.pentagon.mil> wrote:
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>>>Otávio,
>>>>>You could 1) put the info in a hidden variable which would be less secure
or
>>>>>2) put the info in your session.
>>>>>
>>>>>Regards,
>>>>>
>>>>>Richard
>>>>>
>>>>>
>>>>>-----Original Message-----
>>>>>From: Otávio Augusto [mailto:otavio.augusto@bol.com.br] 
>>>>>Sent: Wednesday, January 07, 2004 7:33 PM
>>>>>To: struts-user@jakarta.apache.org
>>>>>Subject: mapped address
>>>>>
>>>>>
>>>>>I have the following situation:
>>>>>
>>>>>In my struts-config.xml file, there are lots of mappings like this one:
>>>>><forward name="vendaconfirma" path="/vendaConfirmacao.jsp" />
>>>>>
>>>>>In my application, the user has the chance to add or remove itens from
a
>>>>>collection which is in the httpsession. There is only one place to add
those
>>>>>itens, but the user can remove then at any time, at least in 3 different
web
>>>>>pages during the workflow.
>>>>>
>>>>>I'd like to implement a single Action class to handle the task of getting
>>>>>the httpsession with those items, remove a certain item and go back to
the
>>>>>page where i requested this task. As I said, there are at least 3 different
>>>>>jsp pages where the user can invoke this "remove" task.
>>>>>
>>>>>The question is: is there a way to get , in the Action class, the mapping
>>>>>for the page where I came from ? At the end of my execute() methods in
my
>>>>>Action classes,I do this
>>>>>
>>>>>return (mapping.findForward(destino));
>>>>>
>>>>>to return to the jsp page. "destino" is a String containig the jsp "alias"
>>>>>mapped in struts-config.xml. Since I can invoke this Action from, at least,
>>>>>3 different places, how to feed "destino" with the correct mapping so
I can
>>>>>rturn to the page I invoked the service from?
>>>>>
>>>>>thanks in advance
>>>>>
>>>>>Otávio Augusto
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>> 
>>>
>>>      
>>>
>>-- 
>>Brice D. Ruth
>>Sr. IT Analyst
>>Fiskars Brands, Inc.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message