<snip>
Using the solution with the Action shows no parameters
</snip>

Attributes and Parameters are *not* the same thing.
Attributes are server side only (and can be any type of object), while
parameters are taken from the request itself and must be Strings.

If you want this value as a parameter this can be achieved by modifying the
request URL you return in the ActionForward.
Since the ActionForward you lookup isnt modifiable (as its a shared
instance) you could create a new ActionForward instance with the appropriate
path and return that from the action. ie:

ActionForward continue = mapping.findForward(Konstanten.CONTINUE);
String continuePath = continue.getPath();
continuePath = addParam(continuePath,
Konstanten.ADRESSEN_RESULT_START_INDEX_KEY, indexListWert);
//assuming indexListWert is a string (you could concat it with one if its
not ie: ""+indexListWert)
return new ActionForward(continuePath, continue.getRedirect());

and where addParam is just a simple method to return a path with the
parameter appended.

Heres a very simple impl:
protected String addParam(String url, String parameter, String value)
{ //Append parameter and value to url using ? if its the first param or & if
its not
  return url + ( (url.indexOf("?")==-1) ? "?" : "&" ) + parameter + "=" +
value;
}

-Alternatively you can recode your JSP to look for it in the attributes
instead of the params, though then you will lose the ability to specify it
in the url. (Or you could have it check both)

-----Original Message-----
From: Mlinar, Mario [mailto:[EMAIL PROTECTED]
Sent: Thursday, 12 February 2004 18:27
To: Struts Users Mailing List
Subject: AW: what is wrong with this code


Just to be sure what is in the request my code at the beginning of the jsp
is:
<%
        java.util.Enumeration e2 = request.getAttributeNames();
    while (e.hasMoreElements()) {
        String tempString = (String) e2.nextElement();
%>      <%= tempString %>=<%= request.getAttribute(tempString) %><br>
<%      } %>


And

<%
        java.util.Enumeration e = request.getParameterNames();
    while (e.hasMoreElements()) {
        String tempString = (String) e.nextElement();
%>      <%= tempString %>=<%= request.getParameter(tempString) %><br>
<%      } %>

Using this kind of link 'adressenView.do?adrStartIndex=5' shows an
'adrStartIndex=5' at the beginning of the jsp
Using the solution with the Action shows no parameters ... where
Konstanten.ADRESSEN_RESULT_START_INDEX_KEY = adrStartIndex

Putting into the session works perfect :-(


-----Ursprüngliche Nachricht-----
Von: Andrew Hill [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 12. Februar 2004 11:09
An: Struts Users Mailing List
Betreff: RE: what is wrong with this code


I presume Konstanten.CONTINUE is "continue" and I see that forward will
default to a non-redirecting forward looking at your config, so thats not
the problem.

Whats in the JSP? You sure you got the attribute key correct there?

-----Original Message-----
From: Mlinar, Mario [mailto:[EMAIL PROTECTED]
Sent: Thursday, 12 February 2004 18:07
To: [EMAIL PROTECTED]
Subject: what is wrong with this code


putting an attribute in my request ... the jsp cant´t find it in there....


request.setAttribute(Konstanten.ADRESSEN_RESULT_START_INDEX_KEY,
indexListWert);
return mapping.findForward(Konstanten.CONTINUE);

struts-config:
<action path="/adressenExtDetail"
       type="de.shs.partnerportal.adb.ui.web.actions.AdressExtDetailAction"
       parameter="/gp_detail_adressen.jsp"
    name="adressenExtDetail"
    scope="session"
    validate="false"
    input="/gp_detail_adressen.jsp">
    <forward
             name="continue"
    path="/gp_detail_adressen.jsp" />
   </action>


Any idea???


---------------------------------------------------------------------
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]

Reply via email to