You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mo...@dit.unitn.it on 2003/03/14 09:15:13 UTC

simple question

Hi, there is a possibility to send an object in the request if i don't pass it
with parameter of the link?
for example:

<% 
request.setAttribute("in","index");
....
%>
...
<hm:link page="/index.jsp" transaction="true">
	home
</hm:link>

this obviously don't work...but there is a system to obtain this whit a Struts
component?
I should pass a String value to action, but this must be not visible in the url.
In particular my action don't know the page that call it and for this... 
I try to pass it as message, but this don't work..
Any idea?
Thanks in advance
Alessio

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


Re: simple question

Posted by mo...@dit.unitn.it.
Thank you, you have been very kind.
Ale



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


Re: simple question

Posted by Nicolas De Loof <ni...@cgey.com>.
You don't need an ActionForm (but you can).

You can use request.getParameter("in") in your action, you can use a
dynaForm too if you don't wan't to create a formBean for this.

As you can read in the code I sent, I did not used <html:form>, so
action form definition is not needed. This beeing said, using a
dynaForm an struts tags would be IMHO the cleaner way, and you will
not have to create the code for a new formbean.

Nico.


> Thank, but with this i must crete an ActionForm...it's possible
avoid to create
> an ActionForm for an form?
> Thank for help
> Ale
>
>
> --------------------------------------------------------------------
-
> 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


Re: simple question

Posted by mo...@dit.unitn.it.
Thank, but with this i must crete an ActionForm...it's possible avoid to create
an ActionForm for an form?
Thank for help
Ale


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


Re: simple question

Posted by Nicolas De Loof <ni...@cgey.com>.
You can try this :

<form name="myLink"
      action="<html:rewrite page="/index.jsp"/>"
      method="POST">
   <input type="hidden" name="in" value="...">
</form>

<a href="javascript:document.forms.myLink.submit()">home</a>

Notice the (not visible) HTML form will add a visual line break in
browser. You can avoid it by putting it a page bottom or in an hidden
div, or between two rows of a table.

Nico.

> <hm:link page="/index.jsp" transaction="true">
> home
> </hm:link>
>
> this obviously don't work...but there is a system to obtain this
whit a Struts
> component?
> I should pass a String value to action, but this must be not visible
in the url.
> In particular my action don't know the page that call it and for
this...
> I try to pass it as message, but this don't work..
> Any idea?
> Thanks in advance
> Alessio
>
> --------------------------------------------------------------------
-
> 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