You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Caroline Jen <ji...@yahoo.com> on 2003/10/30 08:15:41 UTC

How To Submit A Propery/Value Pair That Is Not Selected/Filled-Out By Visitors of the Website?

In the welcome page, all visitors of the web site can
choose to view any article that is available in the
database.  But, visitors will not be able to delete or
update any of those articles (DELETE, UPDATE, etc.
buttons are not provided).  This part of my struts
application works well.  I have a drop-down list
enclosed in <html:form> for visitors to make a
selection and submit it for an action to be taken:

<html:form action="/menu/Find">
<TR>
<TD class="label" nowrap>Find articles by: </TD>
<TD class="input">
<html:select size="1" property="dispatch"
onchange="document.forms[1].elements[2].focus()">
<html:options collection="FIND" property="value"
labelProperty="label"/>
</html:select>

<html:text property="keyValue" size="20"
maxlength="50"/>
</TD>
<TD><html:submit>GO</html:submit></TD>
</TR>
</html:form> 

Visitor can choose articles by title, author,
category, content, or article ID.  If "author" is
selected from the drop-down list and the name of the
author "Victor Hugo" is supplied, keyName will be set
as creator and keyValue will be set as Victor Hugo for
further processing as shown in my struts-config.xml
below:

    <action
        path="/menu/Find"
       
type="org.apache.struts.scaffold.ParameterAction"
        name="menuForm"
        validate="false"
        parameter="keyValue">
        <forward
            name="title"
           
path="/do/find/Property?keyName=title&amp;keyValue="/>
        <forward
            name="author"
           
path="/do/find/Property?keyName=creator&amp;keyValue="/>
        <forward
            name="journal_category"
           
path="/do/find/Property?keyName=journal_category&amp;keyValue="/>
        <forward
            name="content"
           
path="/do/find/Property?keyName=content&amp;keyValue="/>
        <forward
            name="article"
            path="/do/article/View?article="/>
    </action>


After a registered visitor successfully logs in, a
user specific page is displayed.  For example, after
the author Victor Hugo who has submitted several of
his articles at the web site logs in, he will see a
page with "Submit Article" and "View Article" (IT IS A
LINK OR A BUTTON.  IT IS NOT A DROP DOWN LIST), etc. 
The author can view his own articles only because
DELETE, UPDATE, etc. buttons will be provided.

I am stuck here.  There is no drop-down list for
Victor Hugo.  How do I supply keyName (which is
"creator") and keyValue (request.getRemoteUser) to the
action below if Victor Hugo clicks on the "View
Article" button?

    <action
        path="/menu/Find"
        ................
        parameter="keyValue">
        ................
        <forward
            name="author"
           
path="/do/find/Property?keyName=creator&amp;keyValue="/>
        ................
    </action>




__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

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


Re: How To Submit A Propery/Value Pair That Is Not Selected/Filled-Out By Visitors of the Website?

Posted by "Ruth, Brice" <br...@fiskars.com>.
Can you just use hidden form variables? Check out the Struts-HTML 
<html:hidden> tag - that might get you through this.

Caroline Jen wrote:

>In the welcome page, all visitors of the web site can
>choose to view any article that is available in the
>database.  But, visitors will not be able to delete or
>update any of those articles (DELETE, UPDATE, etc.
>buttons are not provided).  This part of my struts
>application works well.  I have a drop-down list
>enclosed in <html:form> for visitors to make a
>selection and submit it for an action to be taken:
>
><html:form action="/menu/Find">
><TR>
><TD class="label" nowrap>Find articles by: </TD>
><TD class="input">
><html:select size="1" property="dispatch"
>onchange="document.forms[1].elements[2].focus()">
><html:options collection="FIND" property="value"
>labelProperty="label"/>
></html:select>
>
><html:text property="keyValue" size="20"
>maxlength="50"/>
></TD>
><TD><html:submit>GO</html:submit></TD>
></TR>
></html:form> 
>
>Visitor can choose articles by title, author,
>category, content, or article ID.  If "author" is
>selected from the drop-down list and the name of the
>author "Victor Hugo" is supplied, keyName will be set
>as creator and keyValue will be set as Victor Hugo for
>further processing as shown in my struts-config.xml
>below:
>
>    <action
>        path="/menu/Find"
>       
>type="org.apache.struts.scaffold.ParameterAction"
>        name="menuForm"
>        validate="false"
>        parameter="keyValue">
>        <forward
>            name="title"
>           
>path="/do/find/Property?keyName=title&amp;keyValue="/>
>        <forward
>            name="author"
>           
>path="/do/find/Property?keyName=creator&amp;keyValue="/>
>        <forward
>            name="journal_category"
>           
>path="/do/find/Property?keyName=journal_category&amp;keyValue="/>
>        <forward
>            name="content"
>           
>path="/do/find/Property?keyName=content&amp;keyValue="/>
>        <forward
>            name="article"
>            path="/do/article/View?article="/>
>    </action>
>
>
>After a registered visitor successfully logs in, a
>user specific page is displayed.  For example, after
>the author Victor Hugo who has submitted several of
>his articles at the web site logs in, he will see a
>page with "Submit Article" and "View Article" (IT IS A
>LINK OR A BUTTON.  IT IS NOT A DROP DOWN LIST), etc. 
>The author can view his own articles only because
>DELETE, UPDATE, etc. buttons will be provided.
>
>I am stuck here.  There is no drop-down list for
>Victor Hugo.  How do I supply keyName (which is
>"creator") and keyValue (request.getRemoteUser) to the
>action below if Victor Hugo clicks on the "View
>Article" button?
>
>    <action
>        path="/menu/Find"
>        ................
>        parameter="keyValue">
>        ................
>        <forward
>            name="author"
>           
>path="/do/find/Property?keyName=creator&amp;keyValue="/>
>        ................
>    </action>
>
>
>
>
>__________________________________
>Do you Yahoo!?
>Exclusive Video Premiere - Britney Spears
>http://launch.yahoo.com/promos/britneyspears/
>
>---------------------------------------------------------------------
>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