You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Yee <ry...@cruzio.com> on 2003/12/08 05:38:40 UTC

Re: Please Help! Unable to Pass A Hidden Field To scaffold.ProcessAction

Are you using the <input type="hidden" ....> or html:hidden attributes? I 
didn't see it in your email.
If you do, the values will be available in the request.

Regards,

Richard

At 08:20 PM 12/7/2003, you wrote:
>I want to pass two hidden fields; username and keyName
>from a JSP via a SUBMIT button:
>
><req:isUserInRole role="editor">
><% String username = request.getRemoteUser();%> value="journal_category"/> 
>value="<%=username%>"/> View Articles and an action mapping: How come the 
>username is not passed to the FindEditorData.java while the keyName is 
>successfully passed. In the browser, I got: name=null; 
>kn=journal_category; kv=null The code of my FindEditorData is shown below: 
>public final class FindEditorData extends Bean { public Object execute() 
>throws Exception { // Obtain username String username = getUsername(); 
>EditorService service = new EditorService(); String value = 
>service.findEditorData( username ); String property = getKeyName(); if (( 
>null==property ) || ( null==value )) { StringBuffer sb = new 
>StringBuffer(); sb.append( "name=" ); sb.append( username ); sb.append( "; 
>kn=" ); sb.append( property ); sb.append( "; kv=" ); sb.append( value ); 
>throw new ParameterException( sb.toString() ); } ResultList list = new 
>ResultListBase ( Access.findByProperty( this,property,value ) ); 
>list.setLegend( property,value ); return new ProcessResultBase( list ); } 
>// end execute } // End FindEditorData __________________________________ 
>Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. 
>http://photos.yahoo.com/ 
>--------------------------------------------------------------------- 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: Please Help! Unable to Pass A Hidden Field To scaffold.ProcessAction

Posted by Caroline Jen <ji...@yahoo.com>.
My code was shown in my original message.  I used two 
<html:hidden ... > tags to pass two hidden fields, one
is successfully passed while the other shows null.  By
the way, I do not use 'request' to retrieve the value
of the hidden field because my Java class is a
scaffold.ProcessAction type.  I simply use getXxx.

Let me show my code again:
<req:isUserInRole role="editor">
<html:form action="/find/Category">
<% String username = request.getRemoteUser();%>
<html:hidden property="keyName"
value="journal_category"/>
<html:hidden property="username"
value="<%=username%>"/>
<html:submit>View Articles</html:submit>
</html:form>
</req:isUserInRole>

--- Richard Yee <ry...@cruzio.com> wrote:
> Are you using the <input type="hidden" ....> or
> html:hidden attributes? I 
> didn't see it in your email.
> If you do, the values will be available in the
> request.
> 
> Regards,
> 
> Richard
> 
> At 08:20 PM 12/7/2003, you wrote:
> >I want to pass two hidden fields; username and
> keyName
> >from a JSP via a SUBMIT button:
> >
> ><req:isUserInRole role="editor">
> ><% String username = request.getRemoteUser();%>
> value="journal_category"/> 
> >value="<%=username%>"/> View Articles and an action
> mapping: How come the 
> >username is not passed to the FindEditorData.java
> while the keyName is 
> >successfully passed. In the browser, I got:
> name=null; 
> >kn=journal_category; kv=null The code of my
> FindEditorData is shown below: 
> >public final class FindEditorData extends Bean {
> public Object execute() 
> >throws Exception { // Obtain username String
> username = getUsername(); 
> >EditorService service = new EditorService(); String
> value = 
> >service.findEditorData( username ); String property
> = getKeyName(); if (( 
> >null==property ) || ( null==value )) { StringBuffer
> sb = new 
> >StringBuffer(); sb.append( "name=" ); sb.append(
> username ); sb.append( "; 
> >kn=" ); sb.append( property ); sb.append( "; kv="
> ); sb.append( value ); 
> >throw new ParameterException( sb.toString() ); }
> ResultList list = new 
> >ResultListBase ( Access.findByProperty(
> this,property,value ) ); 
> >list.setLegend( property,value ); return new
> ProcessResultBase( list ); } 
> >// end execute } // End FindEditorData
> __________________________________ 
> >Do you Yahoo!? New Yahoo! Photos - easier uploading
> and sharing. 
> >http://photos.yahoo.com/ 
>
>---------------------------------------------------------------------
> 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
> 


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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