struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abdullah Jibaly" <Abdullah.Jib...@aeroxchange.com>
Subject RE: actionform session attribute name
Date Fri, 17 Dec 2004 16:31:25 GMT
Hi,

First, thanks for your help Bill. I finally got what I was trying to do by:
1- In the action I store the form name using> request.setAttribute("formName", mapping.getName());
2- In the jsp I retrieve the form object using> <c:set var="form" value="${sessionScope[formName]}"
/>

-Abdullah

-----Original Message-----
From: Bill Siggelkow [mailto:billsigg@bellsouth.net]
Sent: Thursday, December 16, 2004 7:53 AM
To: user@struts.apache.org
Subject: Re: actionform session attribute name


Try this:

<c:set var="form"
 
value="${requestScope['org.apache.struts.action.mapping.instance.name']}"

/>


Abdullah Jibaly wrote:
> Thanks, the forEach works great. The problem with using a hardcoded form name is that
I have an abstract Base form with several derived children each with their own form name.
Using the forEach you sent me though shows that the form name is stored in a request attribute
"org.apache.struts.action.mapping.instance", and the actual bean looks like it's in "org.apache.struts.taglib.html.BEAN".
Is there any easy way of getting these sort of like this... I know what I have here is wrong
:)
> 
> <c:set var="form" value="${request.get('org.apache.struts.action.mapping.instance.name')}"
/>
> 
> then I can access the form using the form var: <c:out value="${form.key}"/>
> 
> -Abdullah
> 
> -----Original Message-----
> From: Bill Siggelkow [mailto:billsigg@bellsouth.net]
> Sent: Wednesday, December 15, 2004 3:55 PM
> To: user@struts.apache.org
> Subject: Re: actionform session attribute name
> 
> 
> Well, for the form you can use the form name as specified in your 
> struts-config.xml.
> 
> To list the attribute keys and values in the request use something like 
> this (works equally well sessionScope and applicationScope):
> 
>      <c:forEach items="${requestScope}" var="itm">
>          <tr>
>              <td><c:out value="${itm.key}"/></td>
>              <td colspan="2">
>                  <textarea rows="2" cols="50">
>                      <c:out value="${itm.value}"/>
>                  </textarea>
>              </td>
>          </tr>
>      </c:forEach>
> 
> -Bill Siggelkow
> 
> 
> Abdullah Jibaly wrote:
> 
> 
>>Hi again,
>>
>>I'm actually trying to get the form name, or a reference to the object, from the JSP
page. Also, how can I (using JSTL) get a list of all attributes and their values in request,
session, and app scope from the JSP page also?
>>
>>Thanks again,
>>Abdullah
>>
>>-----Original Message-----
>>From: Abdullah Jibaly 
>>Sent: Wednesday, December 15, 2004 3:25 PM
>>To: Struts Users Mailing List
>>Subject: actionform session attribute name
>>
>>
>>Hi,
>>
>>How can I get the actionform name from the session?
>>
>>Thanks,
>>Abdullah
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


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


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


Mime
View raw message