You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by javen fang <fa...@yahoo.com.cn> on 2003/10/31 07:58:13 UTC

use html:link pass two param

I have a bean list that have two property id / name

code:
------------------------------------------------------

<html:link action="next.do" paramId="first"
paramName="list" paramProperty="id"> next action
</html:link>

------------------------------------------------------


And how can I pass the second parameter name after the
action next.do??
Thanks.



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: use html:link pass two param

Posted by "Ruth, Brice" <br...@fiskars.com>.
If you have the parameters stored in a java.util.Map object, simply 
specifying the name of that object as the "name" attribute to html:link 
(without any paramId/paramName/paramProperty attributes, will do the 
trick for you.

If your bean list isn't a java.util.Map, you can create one on the fly 
in your JSP like so:

<jsp:useBean id="varName" class="java.util.HashMap"/>
<c:set target="${varName}" property="param1" value="value1"/>
<c:set target="${varName}" property="param2" value="value2"/>

where param1/2 are the names you want the parameters passed as in the 
query string, and value1/2 are the values (which can be populated with 
EL or as the text body of the c:set statement)

After doing this, the "name" attribute to html:link would simply be 
"varName" - which, of course, you can choose to be whatever you want.

Hope this helps!
Brice

javen fang wrote:

>I have a bean list that have two property id / name
>
>code:
>------------------------------------------------------
>
><html:link action="next.do" paramId="first"
>paramName="list" paramProperty="id"> next action
></html:link>
>
>------------------------------------------------------
>
>
>And how can I pass the second parameter name after the
>action next.do??
>Thanks.
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>---------------------------------------------------------------------
>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


RE: use html:link pass two param

Posted by javen fang <fa...@yahoo.com.cn>.
And I change  uri  to
uri="http://java.sun.com/jstl/core" in web.xml and jsp
file, the result is same.


I am so downcast that where is the matter. 

--- javen fang <fa...@yahoo.com.cn> wrote:
> in web.xml
>     <taglib>
>         <taglib-uri>/tags/struts-logic</taglib-uri>
>        
>
<taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
>     </taglib>
>     <taglib>
>         <taglib-uri>/tags/core</taglib-uri>
>        
>
<taglib-location>/WEB-INF/tld/c.tld</taglib-location>
>     </taglib>
> 
> in jsp file:
> <%@ taglib uri="/tags/struts-logic" prefix="logic"
> %>
> <%@ taglib uri="/tags/core" prefix="c" %>
> 
> <logic > tags can work rightly.
> And I use IDE idea it will check if this style is
> not
> right.
> 
> And also, when run it does not prints error that say
> 
> <c:out > he does not know.
> 
> I wonder ....
> 
> 
> --- James Mitchell <jm...@apache.org> wrote:
> > Do you have the directive at the top?
> > 
> > <%@ taglib uri="http://java.sun.com/jstl/core"
> > prefix="c"%>
> > 
> > 
> > 
> > --
> > James Mitchell
> > Software Engineer / Struts Evangelist
> > http://www.struts-atlanta.org
> > 678.910.8017 (c)
> > 770.822.3359 (h)
> > AIM:jmitchtx
> > 
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: javen fang
> [mailto:fajaven2000@yahoo.com.cn]
> > 
> > > Sent: Saturday, November 01, 2003 12:14 PM
> > > To: Struts Users Mailing List
> > > Subject: RE: use html:link pass two param
> > > 
> > > 
> > > Thank you, James
> > > 
> > > But even:
> > > 
> > > <c:out value="${USER.username}"
> default="username"
> > />
> > > <bean:write name="USER" property="username"/>
> > > USER is a user session
> > > <bean:write> can work,and prints myname
> > > <c:out> can not work, and prints  
> > ${USER.username}
> > > 
> > > why ??? 
> > > I seems like  my JSTL does not work rightly.
> > > 
> > > tomcat 5.0 can support jsp2.0 and jstl 1.1 
> > > 
> > > --- James Mitchell <jm...@apache.org> wrote:
> > > > Not sure about the error, but you aren't
> > referencing
> > > > the bean properties
> > > > properly.
> > > > 
> > > > 
> > > > <jsp:useBean id="cus"
> > class="java.util.HashMap"/>
> > > >  ...
> > > >  <c:set target="${cus}" property="cid" 
> > > >         value="list.id"/>
> > > >               ^^^^^^^^^
> > > > 
> > > > ...and...
> > > > 
> > > >  <c:set target="${cus}" property="company"
> > > >         value="list.company"/>
> > > >               ^^^^^^^^^^^^^
> > > > 
> > > > When referencing dynamic properties with JSTL,
> > be
> > > > sure to use ${}
> > > > syntax.
> > > > 
> > > > Try doing this:  value="${list.id}"
> > > > 
> > > > 
> > > > 
> > > > --
> > > > James Mitchell
> > > > Software Engineer / Struts Evangelist
> > > > http://www.struts-atlanta.org
> > > > 678.910.8017 (c)
> > > > 770.822.3359 (h)
> > > > AIM:jmitchtx
> > > > 
> > > > 
> > > > 
> > > > 
> > > > > -----Original Message-----
> > > > > From: javen fang
> > [mailto:fajaven2000@yahoo.com.cn]
> > > > 
> > > > > Sent: Saturday, November 01, 2003 10:45 AM
> > > > > To: Struts Users Mailing List
> > > > > Subject: Re: use html:link pass two param
> > > > > 
> > > > > 
> > > > > Thanks all, thanks James Mitchell!
> > > > > 
> > > > > I use the method James Mitchell tell me.
> > > > > And I read JSTL Spec and tutorial in
> > javaword.com
> > > > >
> > > >
> > >
> >
>
http://www.javaworld.com/javaworld/jw-02-2003/jw-0228-jstl-p3.html
> > > > > 
> > > > > But I encouter a error,and I don't know why
> > this
> > > > > occur:
> > > > > 
> > > > > javax.servlet.ServletException: Invalid
> > property
> > > > in
> > > > > <set>:  "cid"
> > > > > 
> > > > > These are my code:
> > > > > <jsp:useBean id="cus"
> > class="java.util.HashMap"/>
> > > > > ...
> > > > >   <c:set target="${cus}" property="cid"
> > > > > value="list.id"/>
> > > > >   <c:set target="${cus}" property="company"
> > > > > value="list.company"/>
> > > > > <html:link action="linkman_list"
> > > > > name="cus">Linkman</html:link>
> > > > > 
> > > > > My container is tomcat5.0
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > --- Kris Schneider <kr...@dotech.com> wrote:
> > > > > > You can call it whatever you want -
> > "admin-tool"
> > > > > > from James' example. The
> > > > > > difference is this:
> > > > > > 
> > > > > > /app/do/manageUsers
> > > > > > 
> > > > > > vs. this:
> > > > > > 
> > > > > > /app/manageUsers.do
> > > > > > 
> > > > > > I think James was referring to the use of:
> > > > > > 
> > > > > > <html:link action="next.do" ...>
> > > > > > 
> > > > > > when he said, "you should never have to
> put
> > > > ".do"
> > > > > > any where in your
> > > > > > application..." You really only need to
> do:
> > > > > > 
> > > > > > <html:link action="/next" ...>
> > > > > > 
> > > > > > which will work regardless of how you do
> > your
> > > > > > servlet mapping.
> > > > > > 
> > > > > > Quoting "Ruth, Brice" <br...@fiskars.com>:
> > > > > > 
> > > > > > > doesn't this still put 'do' somewhere in
> > the
> > > > URL?
> > > > > > > 
> > > > > > > Kris Schneider wrote:
> > > > > > > 
> > > > > > > >web.xml:
> > > > > > > >
> > > > > > > ><!-- mapping for ActionServlet -->
> > > > > > > ><servlet-mapping>
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


RE: use html:link pass two param

Posted by javen fang <fa...@yahoo.com.cn>.
in web.xml
    <taglib>
        <taglib-uri>/tags/struts-logic</taglib-uri>
       
<taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>/tags/core</taglib-uri>
       
<taglib-location>/WEB-INF/tld/c.tld</taglib-location>
    </taglib>

in jsp file:
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/core" prefix="c" %>

<logic > tags can work rightly.
And I use IDE idea it will check if this style is not
right.

And also, when run it does not prints error that say 
<c:out > he does not know.

I wonder ....


--- James Mitchell <jm...@apache.org> wrote:
> Do you have the directive at the top?
> 
> <%@ taglib uri="http://java.sun.com/jstl/core"
> prefix="c"%>
> 
> 
> 
> --
> James Mitchell
> Software Engineer / Struts Evangelist
> http://www.struts-atlanta.org
> 678.910.8017 (c)
> 770.822.3359 (h)
> AIM:jmitchtx
> 
> 
> 
> 
> > -----Original Message-----
> > From: javen fang [mailto:fajaven2000@yahoo.com.cn]
> 
> > Sent: Saturday, November 01, 2003 12:14 PM
> > To: Struts Users Mailing List
> > Subject: RE: use html:link pass two param
> > 
> > 
> > Thank you, James
> > 
> > But even:
> > 
> > <c:out value="${USER.username}" default="username"
> />
> > <bean:write name="USER" property="username"/>
> > USER is a user session
> > <bean:write> can work,and prints myname
> > <c:out> can not work, and prints  
> ${USER.username}
> > 
> > why ??? 
> > I seems like  my JSTL does not work rightly.
> > 
> > tomcat 5.0 can support jsp2.0 and jstl 1.1 
> > 
> > --- James Mitchell <jm...@apache.org> wrote:
> > > Not sure about the error, but you aren't
> referencing
> > > the bean properties
> > > properly.
> > > 
> > > 
> > > <jsp:useBean id="cus"
> class="java.util.HashMap"/>
> > >  ...
> > >  <c:set target="${cus}" property="cid" 
> > >         value="list.id"/>
> > >               ^^^^^^^^^
> > > 
> > > ...and...
> > > 
> > >  <c:set target="${cus}" property="company"
> > >         value="list.company"/>
> > >               ^^^^^^^^^^^^^
> > > 
> > > When referencing dynamic properties with JSTL,
> be
> > > sure to use ${}
> > > syntax.
> > > 
> > > Try doing this:  value="${list.id}"
> > > 
> > > 
> > > 
> > > --
> > > James Mitchell
> > > Software Engineer / Struts Evangelist
> > > http://www.struts-atlanta.org
> > > 678.910.8017 (c)
> > > 770.822.3359 (h)
> > > AIM:jmitchtx
> > > 
> > > 
> > > 
> > > 
> > > > -----Original Message-----
> > > > From: javen fang
> [mailto:fajaven2000@yahoo.com.cn]
> > > 
> > > > Sent: Saturday, November 01, 2003 10:45 AM
> > > > To: Struts Users Mailing List
> > > > Subject: Re: use html:link pass two param
> > > > 
> > > > 
> > > > Thanks all, thanks James Mitchell!
> > > > 
> > > > I use the method James Mitchell tell me.
> > > > And I read JSTL Spec and tutorial in
> javaword.com
> > > >
> > >
> >
>
http://www.javaworld.com/javaworld/jw-02-2003/jw-0228-jstl-p3.html
> > > > 
> > > > But I encouter a error,and I don't know why
> this
> > > > occur:
> > > > 
> > > > javax.servlet.ServletException: Invalid
> property
> > > in
> > > > <set>:  "cid"
> > > > 
> > > > These are my code:
> > > > <jsp:useBean id="cus"
> class="java.util.HashMap"/>
> > > > ...
> > > >   <c:set target="${cus}" property="cid"
> > > > value="list.id"/>
> > > >   <c:set target="${cus}" property="company"
> > > > value="list.company"/>
> > > > <html:link action="linkman_list"
> > > > name="cus">Linkman</html:link>
> > > > 
> > > > My container is tomcat5.0
> > > > 
> > > > 
> > > > 
> > > > 
> > > > --- Kris Schneider <kr...@dotech.com> wrote:
> > > > > You can call it whatever you want -
> "admin-tool"
> > > > > from James' example. The
> > > > > difference is this:
> > > > > 
> > > > > /app/do/manageUsers
> > > > > 
> > > > > vs. this:
> > > > > 
> > > > > /app/manageUsers.do
> > > > > 
> > > > > I think James was referring to the use of:
> > > > > 
> > > > > <html:link action="next.do" ...>
> > > > > 
> > > > > when he said, "you should never have to put
> > > ".do"
> > > > > any where in your
> > > > > application..." You really only need to do:
> > > > > 
> > > > > <html:link action="/next" ...>
> > > > > 
> > > > > which will work regardless of how you do
> your
> > > > > servlet mapping.
> > > > > 
> > > > > Quoting "Ruth, Brice" <br...@fiskars.com>:
> > > > > 
> > > > > > doesn't this still put 'do' somewhere in
> the
> > > URL?
> > > > > > 
> > > > > > Kris Schneider wrote:
> > > > > > 
> > > > > > >web.xml:
> > > > > > >
> > > > > > ><!-- mapping for ActionServlet -->
> > > > > > ><servlet-mapping>
> > > > > > >  <servlet-name>action</servlet-name>
> > > > > > >  <url-pattern>/do/*</url-pattern>
> > > > > > ></servlet-mapping>
> > > > > > >
> > > > > > >Quoting "Ruth, Brice"
> <br...@fiskars.com>:
> > > > > > >
> > > > > > >  
> > > > > > >
> > > > > > >>How do you go about enabling path
> mapping v.
> > > > > extension mapping in 
> > > > > > >>web.xml (or struts-config.xml)?
> > > > > > >>
> > > > > > >>James Mitchell wrote:
> > > > > > >>
> > > > > > >>    
> > > > > > >>
> > > > > > >>>First of all, you should never have to
> put
> > > > > ".do" any where in your
> > > > > > >>>application except the web.xml file.
> > > > > > >>>That way, you change the mapping in one
> > > place
> > > > > and it flows to the rest
> > > > > > >>>of the application.
> > > > > > >>>
> > > > > > >>>Here's what I do:
> > > > > > >>>
> > > > > > >>>
> > > > > > >>><%@ page
> > > contentType="text/html;charset=UTF-8"
> > > > > language="java" %>
> > > > > > >>><%@ taglib
> uri="/WEB-INF/struts-html.tld"  
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


RE: use html:link pass two param

Posted by James Mitchell <jm...@apache.org>.
Do you have the directive at the top?

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>



--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017 (c)
770.822.3359 (h)
AIM:jmitchtx




> -----Original Message-----
> From: javen fang [mailto:fajaven2000@yahoo.com.cn] 
> Sent: Saturday, November 01, 2003 12:14 PM
> To: Struts Users Mailing List
> Subject: RE: use html:link pass two param
> 
> 
> Thank you, James
> 
> But even:
> 
> <c:out value="${USER.username}" default="username" />
> <bean:write name="USER" property="username"/>
> USER is a user session
> <bean:write> can work,and prints myname
> <c:out> can not work, and prints   ${USER.username}
> 
> why ??? 
> I seems like  my JSTL does not work rightly.
> 
> tomcat 5.0 can support jsp2.0 and jstl 1.1 
> 
> --- James Mitchell <jm...@apache.org> wrote:
> > Not sure about the error, but you aren't referencing
> > the bean properties
> > properly.
> > 
> > 
> > <jsp:useBean id="cus" class="java.util.HashMap"/>
> >  ...
> >  <c:set target="${cus}" property="cid" 
> >         value="list.id"/>
> >               ^^^^^^^^^
> > 
> > ...and...
> > 
> >  <c:set target="${cus}" property="company"
> >         value="list.company"/>
> >               ^^^^^^^^^^^^^
> > 
> > When referencing dynamic properties with JSTL, be
> > sure to use ${}
> > syntax.
> > 
> > Try doing this:  value="${list.id}"
> > 
> > 
> > 
> > --
> > James Mitchell
> > Software Engineer / Struts Evangelist
> > http://www.struts-atlanta.org
> > 678.910.8017 (c)
> > 770.822.3359 (h)
> > AIM:jmitchtx
> > 
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: javen fang [mailto:fajaven2000@yahoo.com.cn]
> > 
> > > Sent: Saturday, November 01, 2003 10:45 AM
> > > To: Struts Users Mailing List
> > > Subject: Re: use html:link pass two param
> > > 
> > > 
> > > Thanks all, thanks James Mitchell!
> > > 
> > > I use the method James Mitchell tell me.
> > > And I read JSTL Spec and tutorial in javaword.com
> > >
> >
> http://www.javaworld.com/javaworld/jw-02-2003/jw-0228-jstl-p3.html
> > > 
> > > But I encouter a error,and I don't know why this
> > > occur:
> > > 
> > > javax.servlet.ServletException: Invalid property
> > in
> > > <set>:  "cid"
> > > 
> > > These are my code:
> > > <jsp:useBean id="cus" class="java.util.HashMap"/>
> > > ...
> > >   <c:set target="${cus}" property="cid"
> > > value="list.id"/>
> > >   <c:set target="${cus}" property="company"
> > > value="list.company"/>
> > > <html:link action="linkman_list"
> > > name="cus">Linkman</html:link>
> > > 
> > > My container is tomcat5.0
> > > 
> > > 
> > > 
> > > 
> > > --- Kris Schneider <kr...@dotech.com> wrote:
> > > > You can call it whatever you want - "admin-tool"
> > > > from James' example. The
> > > > difference is this:
> > > > 
> > > > /app/do/manageUsers
> > > > 
> > > > vs. this:
> > > > 
> > > > /app/manageUsers.do
> > > > 
> > > > I think James was referring to the use of:
> > > > 
> > > > <html:link action="next.do" ...>
> > > > 
> > > > when he said, "you should never have to put
> > ".do"
> > > > any where in your
> > > > application..." You really only need to do:
> > > > 
> > > > <html:link action="/next" ...>
> > > > 
> > > > which will work regardless of how you do your
> > > > servlet mapping.
> > > > 
> > > > Quoting "Ruth, Brice" <br...@fiskars.com>:
> > > > 
> > > > > doesn't this still put 'do' somewhere in the
> > URL?
> > > > > 
> > > > > Kris Schneider wrote:
> > > > > 
> > > > > >web.xml:
> > > > > >
> > > > > ><!-- mapping for ActionServlet -->
> > > > > ><servlet-mapping>
> > > > > >  <servlet-name>action</servlet-name>
> > > > > >  <url-pattern>/do/*</url-pattern>
> > > > > ></servlet-mapping>
> > > > > >
> > > > > >Quoting "Ruth, Brice" <br...@fiskars.com>:
> > > > > >
> > > > > >  
> > > > > >
> > > > > >>How do you go about enabling path mapping v.
> > > > extension mapping in 
> > > > > >>web.xml (or struts-config.xml)?
> > > > > >>
> > > > > >>James Mitchell wrote:
> > > > > >>
> > > > > >>    
> > > > > >>
> > > > > >>>First of all, you should never have to put
> > > > ".do" any where in your
> > > > > >>>application except the web.xml file.
> > > > > >>>That way, you change the mapping in one
> > place
> > > > and it flows to the rest
> > > > > >>>of the application.
> > > > > >>>
> > > > > >>>Here's what I do:
> > > > > >>>
> > > > > >>>
> > > > > >>><%@ page
> > contentType="text/html;charset=UTF-8"
> > > > language="java" %>
> > > > > >>><%@ taglib uri="/WEB-INF/struts-html.tld"  
> >   
> > > > prefix="html" %>
> > > > > >>><%@ taglib
> > uri="http://java.sun.com/jstl/core"
> > > > prefix="c"%>
> > > > > >>>
> > > > > >>>
> > > > > >>><jsp:useBean id="userDetailLink"
> > > > class="java.util.HashMap"/>
> > > > > >>>
> > > > > >>><c:set target="${userDetailLink}"
> > > > property="action" value="editUser"/>
> > > > > >>><c:set target="${userDetailLink}"
> > property="id"
> > > > value="${user.id}"/>
> > > > > >>>
> > > > > >>><html:link action="/manageUsers"
> > > > name="userDetailLink">
> > > > > >>>	Edit this user
> > > > > >>></html:link>
> > > > > >>>
> > > > > >>>
> > > > > >>>
> > > > > >>>Which produces a link like this:
> > > > > >>>
> > > > > >>><a
> > > >
> > >
> >
> href="/app/admin-tool/manageUsers?action=editUser&amp;id=44">Edit
> > > > > >>>this user</a>
> > > > > >>>
> > > > > >>>
> > > > > >>>The above example uses path mapping, but if
> > I
> > > > were using extension
> > > > > >>>mapping (*.do), it looks like this:
> > > > > >>>
> > > > > >>>(with no changes to the source jsp)
> > > > > >>>
> > > > > >>><a
> > > >
> > >
> >
> href="/app/manageUsers.do?action=editUser&amp;id=44">Edit
> > > > this
> > > > > >>>user</a>
> > > > > >>>
> > > > > >>>
> > > > > >>>
> > > > > >>>--
> > > > > >>>James Mitchell
> > > > > >>>Software Engineer / Struts Evangelist
> > > > > >>>http://www.struts-atlanta.org
> > > > > >>>678.910.8017 (c)
> > > > > >>>770.822.3359 (h)
> > > > > >>>AIM:jmitchtx
> > > > > >>>
> > > > > >>>
> > > > > >>>
> > > > > >>>
> > > > > >>> 
> > > > > >>>
> > 
> === message truncated ===
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.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: use html:link pass two param

Posted by javen fang <fa...@yahoo.com.cn>.
Thank you, James

But even:

<c:out value="${USER.username}" default="username" />
<bean:write name="USER" property="username"/>
USER is a user session
<bean:write> can work,and prints myname
<c:out> can not work, and prints   ${USER.username}

why ??? 
I seems like  my JSTL does not work rightly.

tomcat 5.0 can support jsp2.0 and jstl 1.1 

--- James Mitchell <jm...@apache.org> wrote:
> Not sure about the error, but you aren't referencing
> the bean properties
> properly.
> 
> 
> <jsp:useBean id="cus" class="java.util.HashMap"/>
>  ...
>  <c:set target="${cus}" property="cid" 
>         value="list.id"/>
>               ^^^^^^^^^
> 
> ...and...
> 
>  <c:set target="${cus}" property="company"
>         value="list.company"/>
>               ^^^^^^^^^^^^^
> 
> When referencing dynamic properties with JSTL, be
> sure to use ${}
> syntax.
> 
> Try doing this:  value="${list.id}"
> 
> 
> 
> --
> James Mitchell
> Software Engineer / Struts Evangelist
> http://www.struts-atlanta.org
> 678.910.8017 (c)
> 770.822.3359 (h)
> AIM:jmitchtx
> 
> 
> 
> 
> > -----Original Message-----
> > From: javen fang [mailto:fajaven2000@yahoo.com.cn]
> 
> > Sent: Saturday, November 01, 2003 10:45 AM
> > To: Struts Users Mailing List
> > Subject: Re: use html:link pass two param
> > 
> > 
> > Thanks all, thanks James Mitchell!
> > 
> > I use the method James Mitchell tell me.
> > And I read JSTL Spec and tutorial in javaword.com
> >
>
http://www.javaworld.com/javaworld/jw-02-2003/jw-0228-jstl-p3.html
> > 
> > But I encouter a error,and I don't know why this
> > occur:
> > 
> > javax.servlet.ServletException: Invalid property
> in
> > <set>:  "cid"
> > 
> > These are my code:
> > <jsp:useBean id="cus" class="java.util.HashMap"/>
> > ...
> >   <c:set target="${cus}" property="cid"
> > value="list.id"/>
> >   <c:set target="${cus}" property="company"
> > value="list.company"/>
> > <html:link action="linkman_list"
> > name="cus">Linkman</html:link>
> > 
> > My container is tomcat5.0
> > 
> > 
> > 
> > 
> > --- Kris Schneider <kr...@dotech.com> wrote:
> > > You can call it whatever you want - "admin-tool"
> > > from James' example. The
> > > difference is this:
> > > 
> > > /app/do/manageUsers
> > > 
> > > vs. this:
> > > 
> > > /app/manageUsers.do
> > > 
> > > I think James was referring to the use of:
> > > 
> > > <html:link action="next.do" ...>
> > > 
> > > when he said, "you should never have to put
> ".do"
> > > any where in your
> > > application..." You really only need to do:
> > > 
> > > <html:link action="/next" ...>
> > > 
> > > which will work regardless of how you do your
> > > servlet mapping.
> > > 
> > > Quoting "Ruth, Brice" <br...@fiskars.com>:
> > > 
> > > > doesn't this still put 'do' somewhere in the
> URL?
> > > > 
> > > > Kris Schneider wrote:
> > > > 
> > > > >web.xml:
> > > > >
> > > > ><!-- mapping for ActionServlet -->
> > > > ><servlet-mapping>
> > > > >  <servlet-name>action</servlet-name>
> > > > >  <url-pattern>/do/*</url-pattern>
> > > > ></servlet-mapping>
> > > > >
> > > > >Quoting "Ruth, Brice" <br...@fiskars.com>:
> > > > >
> > > > >  
> > > > >
> > > > >>How do you go about enabling path mapping v.
> > > extension mapping in 
> > > > >>web.xml (or struts-config.xml)?
> > > > >>
> > > > >>James Mitchell wrote:
> > > > >>
> > > > >>    
> > > > >>
> > > > >>>First of all, you should never have to put
> > > ".do" any where in your
> > > > >>>application except the web.xml file.
> > > > >>>That way, you change the mapping in one
> place
> > > and it flows to the rest
> > > > >>>of the application.
> > > > >>>
> > > > >>>Here's what I do:
> > > > >>>
> > > > >>>
> > > > >>><%@ page
> contentType="text/html;charset=UTF-8"
> > > language="java" %>
> > > > >>><%@ taglib uri="/WEB-INF/struts-html.tld"  
>   
> > > prefix="html" %>
> > > > >>><%@ taglib
> uri="http://java.sun.com/jstl/core"
> > > prefix="c"%>
> > > > >>>
> > > > >>>
> > > > >>><jsp:useBean id="userDetailLink"
> > > class="java.util.HashMap"/>
> > > > >>>
> > > > >>><c:set target="${userDetailLink}"
> > > property="action" value="editUser"/>
> > > > >>><c:set target="${userDetailLink}"
> property="id"
> > > value="${user.id}"/>
> > > > >>>
> > > > >>><html:link action="/manageUsers"
> > > name="userDetailLink">
> > > > >>>	Edit this user
> > > > >>></html:link>
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>Which produces a link like this:
> > > > >>>
> > > > >>><a
> > >
> >
>
href="/app/admin-tool/manageUsers?action=editUser&amp;id=44">Edit
> > > > >>>this user</a>
> > > > >>>
> > > > >>>
> > > > >>>The above example uses path mapping, but if
> I
> > > were using extension
> > > > >>>mapping (*.do), it looks like this:
> > > > >>>
> > > > >>>(with no changes to the source jsp)
> > > > >>>
> > > > >>><a
> > >
> >
>
href="/app/manageUsers.do?action=editUser&amp;id=44">Edit
> > > this
> > > > >>>user</a>
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>--
> > > > >>>James Mitchell
> > > > >>>Software Engineer / Struts Evangelist
> > > > >>>http://www.struts-atlanta.org
> > > > >>>678.910.8017 (c)
> > > > >>>770.822.3359 (h)
> > > > >>>AIM:jmitchtx
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>> 
> > > > >>>
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


RE: use html:link pass two param

Posted by James Mitchell <jm...@apache.org>.
Not sure about the error, but you aren't referencing the bean properties
properly.


<jsp:useBean id="cus" class="java.util.HashMap"/>
 ...
 <c:set target="${cus}" property="cid" 
        value="list.id"/>
              ^^^^^^^^^

...and...

 <c:set target="${cus}" property="company"
        value="list.company"/>
              ^^^^^^^^^^^^^

When referencing dynamic properties with JSTL, be sure to use ${}
syntax.

Try doing this:  value="${list.id}"



--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017 (c)
770.822.3359 (h)
AIM:jmitchtx




> -----Original Message-----
> From: javen fang [mailto:fajaven2000@yahoo.com.cn] 
> Sent: Saturday, November 01, 2003 10:45 AM
> To: Struts Users Mailing List
> Subject: Re: use html:link pass two param
> 
> 
> Thanks all, thanks James Mitchell!
> 
> I use the method James Mitchell tell me.
> And I read JSTL Spec and tutorial in javaword.com
> http://www.javaworld.com/javaworld/jw-02-2003/jw-0228-jstl-p3.html
> 
> But I encouter a error,and I don't know why this
> occur:
> 
> javax.servlet.ServletException: Invalid property in
> <set>:  "cid"
> 
> These are my code:
> <jsp:useBean id="cus" class="java.util.HashMap"/>
> ...
>   <c:set target="${cus}" property="cid"
> value="list.id"/>
>   <c:set target="${cus}" property="company"
> value="list.company"/>
> <html:link action="linkman_list"
> name="cus">Linkman</html:link>
> 
> My container is tomcat5.0
> 
> 
> 
> 
> --- Kris Schneider <kr...@dotech.com> wrote:
> > You can call it whatever you want - "admin-tool"
> > from James' example. The
> > difference is this:
> > 
> > /app/do/manageUsers
> > 
> > vs. this:
> > 
> > /app/manageUsers.do
> > 
> > I think James was referring to the use of:
> > 
> > <html:link action="next.do" ...>
> > 
> > when he said, "you should never have to put ".do"
> > any where in your
> > application..." You really only need to do:
> > 
> > <html:link action="/next" ...>
> > 
> > which will work regardless of how you do your
> > servlet mapping.
> > 
> > Quoting "Ruth, Brice" <br...@fiskars.com>:
> > 
> > > doesn't this still put 'do' somewhere in the URL?
> > > 
> > > Kris Schneider wrote:
> > > 
> > > >web.xml:
> > > >
> > > ><!-- mapping for ActionServlet -->
> > > ><servlet-mapping>
> > > >  <servlet-name>action</servlet-name>
> > > >  <url-pattern>/do/*</url-pattern>
> > > ></servlet-mapping>
> > > >
> > > >Quoting "Ruth, Brice" <br...@fiskars.com>:
> > > >
> > > >  
> > > >
> > > >>How do you go about enabling path mapping v.
> > extension mapping in 
> > > >>web.xml (or struts-config.xml)?
> > > >>
> > > >>James Mitchell wrote:
> > > >>
> > > >>    
> > > >>
> > > >>>First of all, you should never have to put
> > ".do" any where in your
> > > >>>application except the web.xml file.
> > > >>>That way, you change the mapping in one place
> > and it flows to the rest
> > > >>>of the application.
> > > >>>
> > > >>>Here's what I do:
> > > >>>
> > > >>>
> > > >>><%@ page contentType="text/html;charset=UTF-8"
> > language="java" %>
> > > >>><%@ taglib uri="/WEB-INF/struts-html.tld"     
> > prefix="html" %>
> > > >>><%@ taglib uri="http://java.sun.com/jstl/core"
> > prefix="c"%>
> > > >>>
> > > >>>
> > > >>><jsp:useBean id="userDetailLink"
> > class="java.util.HashMap"/>
> > > >>>
> > > >>><c:set target="${userDetailLink}"
> > property="action" value="editUser"/>
> > > >>><c:set target="${userDetailLink}" property="id"
> > value="${user.id}"/>
> > > >>>
> > > >>><html:link action="/manageUsers"
> > name="userDetailLink">
> > > >>>	Edit this user
> > > >>></html:link>
> > > >>>
> > > >>>
> > > >>>
> > > >>>Which produces a link like this:
> > > >>>
> > > >>><a
> >
> href="/app/admin-tool/manageUsers?action=editUser&amp;id=44">Edit
> > > >>>this user</a>
> > > >>>
> > > >>>
> > > >>>The above example uses path mapping, but if I
> > were using extension
> > > >>>mapping (*.do), it looks like this:
> > > >>>
> > > >>>(with no changes to the source jsp)
> > > >>>
> > > >>><a
> >
> href="/app/manageUsers.do?action=editUser&amp;id=44">Edit
> > this
> > > >>>user</a>
> > > >>>
> > > >>>
> > > >>>
> > > >>>--
> > > >>>James Mitchell
> > > >>>Software Engineer / Struts Evangelist
> > > >>>http://www.struts-atlanta.org
> > > >>>678.910.8017 (c)
> > > >>>770.822.3359 (h)
> > > >>>AIM:jmitchtx
> > > >>>
> > > >>>
> > > >>>
> > > >>>
> > > >>> 
> > > >>>
> > > >>>      
> > > >>>
> > > >>>>-----Original Message-----
> > > >>>>From: javen fang
> > [mailto:fajaven2000@yahoo.com.cn] 
> > > >>>>Sent: Friday, October 31, 2003 1:58 AM
> > > >>>>To: struts
> > > >>>>Subject: use html:link pass two param
> > > >>>>
> > > >>>>
> > > >>>>I have a bean list that have two property id /
> > name
> > > >>>>
> > > >>>>code:
> > >
> >
> >>>>------------------------------------------------------
> > > >>>>
> > > >>>><html:link action="next.do" paramId="first"
> > > >>>>paramName="list" paramProperty="id"> next
> > action
> > > >>>></html:link>
> > > >>>>
> > >
> >
> >>>>------------------------------------------------------
> > > >>>>
> > > >>>>
> > > >>>>And how can I pass the second parameter name
> > after the
> > > >>>>action next.do??
> > > >>>>Thanks.
> > > >>>>
> > > >>>>
> > > >>>>
> > >
> >
> >>>>__________________________________________________
> > > >>>>Do You Yahoo!?
> > > >>>>Tired of spam?  Yahoo! Mail has the best spam
> > protection around 
> > > >>>>http://mail.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
> > > >>>
> > > >>> 
> > > >>>
> > > >>>      
> > > >>>
> > > >>-- 
> > > >>Brice D. Ruth
> > > >>Sr. IT Analyst
> > > >>Fiskars Brands, Inc.
> > > >>    
> > > >>
> > > >
> > > >  
> > > >
> > > 
> > > -- 
> > > Brice D. Ruth
> > > Sr. IT Analyst
> > > Fiskars Brands, Inc.
> > 
> > -- 
> > Kris Schneider <ma...@dotech.com>
> > D.O.Tech       <http://www.dotech.com/>
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > struts-user-help@jakarta.apache.org
> > 
> === message truncated ===
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.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: use html:link pass two param

Posted by javen fang <fa...@yahoo.com.cn>.
Thanks all, thanks James Mitchell!

I use the method James Mitchell tell me.
And I read JSTL Spec and tutorial in javaword.com
http://www.javaworld.com/javaworld/jw-02-2003/jw-0228-jstl-p3.html

But I encouter a error,and I don't know why this
occur:

javax.servlet.ServletException: Invalid property in
<set>:  "cid"

These are my code:
<jsp:useBean id="cus" class="java.util.HashMap"/>
...
  <c:set target="${cus}" property="cid"
value="list.id"/>
  <c:set target="${cus}" property="company"
value="list.company"/>
<html:link action="linkman_list"
name="cus">Linkman</html:link>

My container is tomcat5.0




--- Kris Schneider <kr...@dotech.com> wrote:
> You can call it whatever you want - "admin-tool"
> from James' example. The
> difference is this:
> 
> /app/do/manageUsers
> 
> vs. this:
> 
> /app/manageUsers.do
> 
> I think James was referring to the use of:
> 
> <html:link action="next.do" ...>
> 
> when he said, "you should never have to put ".do"
> any where in your
> application..." You really only need to do:
> 
> <html:link action="/next" ...>
> 
> which will work regardless of how you do your
> servlet mapping.
> 
> Quoting "Ruth, Brice" <br...@fiskars.com>:
> 
> > doesn't this still put 'do' somewhere in the URL?
> > 
> > Kris Schneider wrote:
> > 
> > >web.xml:
> > >
> > ><!-- mapping for ActionServlet -->
> > ><servlet-mapping>
> > >  <servlet-name>action</servlet-name>
> > >  <url-pattern>/do/*</url-pattern>
> > ></servlet-mapping>
> > >
> > >Quoting "Ruth, Brice" <br...@fiskars.com>:
> > >
> > >  
> > >
> > >>How do you go about enabling path mapping v.
> extension mapping in 
> > >>web.xml (or struts-config.xml)?
> > >>
> > >>James Mitchell wrote:
> > >>
> > >>    
> > >>
> > >>>First of all, you should never have to put
> ".do" any where in your
> > >>>application except the web.xml file.
> > >>>That way, you change the mapping in one place
> and it flows to the rest
> > >>>of the application.
> > >>>
> > >>>Here's what I do:
> > >>>
> > >>>
> > >>><%@ page contentType="text/html;charset=UTF-8"
> language="java" %>
> > >>><%@ taglib uri="/WEB-INF/struts-html.tld"     
> prefix="html" %>
> > >>><%@ taglib uri="http://java.sun.com/jstl/core"
> prefix="c"%>
> > >>>
> > >>>
> > >>><jsp:useBean id="userDetailLink"
> class="java.util.HashMap"/>
> > >>>
> > >>><c:set target="${userDetailLink}"
> property="action" value="editUser"/>
> > >>><c:set target="${userDetailLink}" property="id"
> value="${user.id}"/>
> > >>>
> > >>><html:link action="/manageUsers"
> name="userDetailLink">
> > >>>	Edit this user
> > >>></html:link>
> > >>>
> > >>>
> > >>>
> > >>>Which produces a link like this:
> > >>>
> > >>><a
>
href="/app/admin-tool/manageUsers?action=editUser&amp;id=44">Edit
> > >>>this user</a>
> > >>>
> > >>>
> > >>>The above example uses path mapping, but if I
> were using extension
> > >>>mapping (*.do), it looks like this:
> > >>>
> > >>>(with no changes to the source jsp)
> > >>>
> > >>><a
>
href="/app/manageUsers.do?action=editUser&amp;id=44">Edit
> this
> > >>>user</a>
> > >>>
> > >>>
> > >>>
> > >>>--
> > >>>James Mitchell
> > >>>Software Engineer / Struts Evangelist
> > >>>http://www.struts-atlanta.org
> > >>>678.910.8017 (c)
> > >>>770.822.3359 (h)
> > >>>AIM:jmitchtx
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> 
> > >>>
> > >>>      
> > >>>
> > >>>>-----Original Message-----
> > >>>>From: javen fang
> [mailto:fajaven2000@yahoo.com.cn] 
> > >>>>Sent: Friday, October 31, 2003 1:58 AM
> > >>>>To: struts
> > >>>>Subject: use html:link pass two param
> > >>>>
> > >>>>
> > >>>>I have a bean list that have two property id /
> name
> > >>>>
> > >>>>code:
> >
>
>>>>------------------------------------------------------
> > >>>>
> > >>>><html:link action="next.do" paramId="first"
> > >>>>paramName="list" paramProperty="id"> next
> action
> > >>>></html:link>
> > >>>>
> >
>
>>>>------------------------------------------------------
> > >>>>
> > >>>>
> > >>>>And how can I pass the second parameter name
> after the
> > >>>>action next.do??
> > >>>>Thanks.
> > >>>>
> > >>>>
> > >>>>
> >
>
>>>>__________________________________________________
> > >>>>Do You Yahoo!?
> > >>>>Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > >>>>http://mail.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
> > >>>
> > >>> 
> > >>>
> > >>>      
> > >>>
> > >>-- 
> > >>Brice D. Ruth
> > >>Sr. IT Analyst
> > >>Fiskars Brands, Inc.
> > >>    
> > >>
> > >
> > >  
> > >
> > 
> > -- 
> > Brice D. Ruth
> > Sr. IT Analyst
> > Fiskars Brands, Inc.
> 
> -- 
> Kris Schneider <ma...@dotech.com>
> D.O.Tech       <http://www.dotech.com/>
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: use html:link pass two param

Posted by javen fang <fa...@yahoo.com.cn>.
Thanks all, thanks James Mitchell!

I use the method James Mitchell tell me.
And I read JSTL Spec and tutorial in javaword.com
http://www.javaworld.com/javaworld/jw-02-2003/jw-0228-jstl-p3.html

But I encouter a error,and I don't know why this
occur:

javax.servlet.ServletException: Invalid property in
<set>:  "cid"

These are my code:
<jsp:useBean id="cus" class="java.util.HashMap"/>
...
  <c:set target="${cus}" property="cid"
value="list.id"/>
  <c:set target="${cus}" property="company"
value="list.company"/>
<html:link action="linkman_list"
name="cus">Linkman</html:link>

My container is tomcat5.0

--- Kris Schneider <kr...@dotech.com> wrote:
> You can call it whatever you want - "admin-tool"
> from James' example. The
> difference is this:
> 
> /app/do/manageUsers
> 
> vs. this:
> 
> /app/manageUsers.do
> 
> I think James was referring to the use of:
> 
> <html:link action="next.do" ...>
> 
> when he said, "you should never have to put ".do"
> any where in your
> application..." You really only need to do:
> 
> <html:link action="/next" ...>
> 
> which will work regardless of how you do your
> servlet mapping.
> 
> Quoting "Ruth, Brice" <br...@fiskars.com>:
> 
> > doesn't this still put 'do' somewhere in the URL?
> > 
> > Kris Schneider wrote:
> > 
> > >web.xml:
> > >
> > ><!-- mapping for ActionServlet -->
> > ><servlet-mapping>
> > >  <servlet-name>action</servlet-name>
> > >  <url-pattern>/do/*</url-pattern>
> > ></servlet-mapping>
> > >
> > >Quoting "Ruth, Brice" <br...@fiskars.com>:
> > >
> > >  
> > >
> > >>How do you go about enabling path mapping v.
> extension mapping in 
> > >>web.xml (or struts-config.xml)?
> > >>
> > >>James Mitchell wrote:
> > >>
> > >>    
> > >>
> > >>>First of all, you should never have to put
> ".do" any where in your
> > >>>application except the web.xml file.
> > >>>That way, you change the mapping in one place
> and it flows to the rest
> > >>>of the application.
> > >>>
> > >>>Here's what I do:
> > >>>
> > >>>
> > >>><%@ page contentType="text/html;charset=UTF-8"
> language="java" %>
> > >>><%@ taglib uri="/WEB-INF/struts-html.tld"     
> prefix="html" %>
> > >>><%@ taglib uri="http://java.sun.com/jstl/core"
> prefix="c"%>
> > >>>
> > >>>
> > >>><jsp:useBean id="userDetailLink"
> class="java.util.HashMap"/>
> > >>>
> > >>><c:set target="${userDetailLink}"
> property="action" value="editUser"/>
> > >>><c:set target="${userDetailLink}" property="id"
> value="${user.id}"/>
> > >>>
> > >>><html:link action="/manageUsers"
> name="userDetailLink">
> > >>>	Edit this user
> > >>></html:link>
> > >>>
> > >>>
> > >>>
> > >>>Which produces a link like this:
> > >>>
> > >>><a
>
href="/app/admin-tool/manageUsers?action=editUser&amp;id=44">Edit
> > >>>this user</a>
> > >>>
> > >>>
> > >>>The above example uses path mapping, but if I
> were using extension
> > >>>mapping (*.do), it looks like this:
> > >>>
> > >>>(with no changes to the source jsp)
> > >>>
> > >>><a
>
href="/app/manageUsers.do?action=editUser&amp;id=44">Edit
> this
> > >>>user</a>
> > >>>
> > >>>
> > >>>
> > >>>--
> > >>>James Mitchell
> > >>>Software Engineer / Struts Evangelist
> > >>>http://www.struts-atlanta.org
> > >>>678.910.8017 (c)
> > >>>770.822.3359 (h)
> > >>>AIM:jmitchtx
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> 
> > >>>
> > >>>      
> > >>>
> > >>>>-----Original Message-----
> > >>>>From: javen fang
> [mailto:fajaven2000@yahoo.com.cn] 
> > >>>>Sent: Friday, October 31, 2003 1:58 AM
> > >>>>To: struts
> > >>>>Subject: use html:link pass two param
> > >>>>
> > >>>>
> > >>>>I have a bean list that have two property id /
> name
> > >>>>
> > >>>>code:
> >
>
>>>>------------------------------------------------------
> > >>>>
> > >>>><html:link action="next.do" paramId="first"
> > >>>>paramName="list" paramProperty="id"> next
> action
> > >>>></html:link>
> > >>>>
> >
>
>>>>------------------------------------------------------
> > >>>>
> > >>>>
> > >>>>And how can I pass the second parameter name
> after the
> > >>>>action next.do??
> > >>>>Thanks.
> > >>>>
> > >>>>
> > >>>>
> >
>
>>>>__________________________________________________
> > >>>>Do You Yahoo!?
> > >>>>Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > >>>>http://mail.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
> > >>>
> > >>> 
> > >>>
> > >>>      
> > >>>
> > >>-- 
> > >>Brice D. Ruth
> > >>Sr. IT Analyst
> > >>Fiskars Brands, Inc.
> > >>    
> > >>
> > >
> > >  
> > >
> > 
> > -- 
> > Brice D. Ruth
> > Sr. IT Analyst
> > Fiskars Brands, Inc.
> 
> -- 
> Kris Schneider <ma...@dotech.com>
> D.O.Tech       <http://www.dotech.com/>
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: use html:link pass two param

Posted by Kris Schneider <kr...@dotech.com>.
You can call it whatever you want - "admin-tool" from James' example. The
difference is this:

/app/do/manageUsers

vs. this:

/app/manageUsers.do

I think James was referring to the use of:

<html:link action="next.do" ...>

when he said, "you should never have to put ".do" any where in your
application..." You really only need to do:

<html:link action="/next" ...>

which will work regardless of how you do your servlet mapping.

Quoting "Ruth, Brice" <br...@fiskars.com>:

> doesn't this still put 'do' somewhere in the URL?
> 
> Kris Schneider wrote:
> 
> >web.xml:
> >
> ><!-- mapping for ActionServlet -->
> ><servlet-mapping>
> >  <servlet-name>action</servlet-name>
> >  <url-pattern>/do/*</url-pattern>
> ></servlet-mapping>
> >
> >Quoting "Ruth, Brice" <br...@fiskars.com>:
> >
> >  
> >
> >>How do you go about enabling path mapping v. extension mapping in 
> >>web.xml (or struts-config.xml)?
> >>
> >>James Mitchell wrote:
> >>
> >>    
> >>
> >>>First of all, you should never have to put ".do" any where in your
> >>>application except the web.xml file.
> >>>That way, you change the mapping in one place and it flows to the rest
> >>>of the application.
> >>>
> >>>Here's what I do:
> >>>
> >>>
> >>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
> >>><%@ taglib uri="/WEB-INF/struts-html.tld"      prefix="html" %>
> >>><%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
> >>>
> >>>
> >>><jsp:useBean id="userDetailLink" class="java.util.HashMap"/>
> >>>
> >>><c:set target="${userDetailLink}" property="action" value="editUser"/>
> >>><c:set target="${userDetailLink}" property="id" value="${user.id}"/>
> >>>
> >>><html:link action="/manageUsers" name="userDetailLink">
> >>>	Edit this user
> >>></html:link>
> >>>
> >>>
> >>>
> >>>Which produces a link like this:
> >>>
> >>><a href="/app/admin-tool/manageUsers?action=editUser&amp;id=44">Edit
> >>>this user</a>
> >>>
> >>>
> >>>The above example uses path mapping, but if I were using extension
> >>>mapping (*.do), it looks like this:
> >>>
> >>>(with no changes to the source jsp)
> >>>
> >>><a href="/app/manageUsers.do?action=editUser&amp;id=44">Edit this
> >>>user</a>
> >>>
> >>>
> >>>
> >>>--
> >>>James Mitchell
> >>>Software Engineer / Struts Evangelist
> >>>http://www.struts-atlanta.org
> >>>678.910.8017 (c)
> >>>770.822.3359 (h)
> >>>AIM:jmitchtx
> >>>
> >>>
> >>>
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>>>-----Original Message-----
> >>>>From: javen fang [mailto:fajaven2000@yahoo.com.cn] 
> >>>>Sent: Friday, October 31, 2003 1:58 AM
> >>>>To: struts
> >>>>Subject: use html:link pass two param
> >>>>
> >>>>
> >>>>I have a bean list that have two property id / name
> >>>>
> >>>>code:
> >>>>------------------------------------------------------
> >>>>
> >>>><html:link action="next.do" paramId="first"
> >>>>paramName="list" paramProperty="id"> next action
> >>>></html:link>
> >>>>
> >>>>------------------------------------------------------
> >>>>
> >>>>
> >>>>And how can I pass the second parameter name after the
> >>>>action next.do??
> >>>>Thanks.
> >>>>
> >>>>
> >>>>
> >>>>__________________________________________________
> >>>>Do You Yahoo!?
> >>>>Tired of spam?  Yahoo! Mail has the best spam protection around 
> >>>>http://mail.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
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>-- 
> >>Brice D. Ruth
> >>Sr. IT Analyst
> >>Fiskars Brands, Inc.
> >>    
> >>
> >
> >  
> >
> 
> -- 
> Brice D. Ruth
> Sr. IT Analyst
> Fiskars Brands, Inc.

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

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


Re: use html:link pass two param

Posted by "Ruth, Brice" <br...@fiskars.com>.
Coolio, thanks!

James Mitchell wrote:

>See Section 11.2 of the Servlet 2.3 API Specification or Section 10.2 of
>the Servet 2.2 API Specification.
>
>Then "do" some testing....pun intended ;)
>
>
>
>--
>James Mitchell
>Software Engineer / Struts Evangelist
>http://www.struts-atlanta.org
>678.910.8017 (c)
>770.822.3359 (h)
>AIM:jmitchtx
>
>
>
>
>  
>
>>-----Original Message-----
>>From: Ruth, Brice [mailto:bruth@fiskars.com] 
>>Sent: Friday, October 31, 2003 11:03 AM
>>To: Struts Users Mailing List
>>Subject: Re: use html:link pass two param
>>
>>
>>doesn't this still put 'do' somewhere in the URL?
>>
>>Kris Schneider wrote:
>>
>>    
>>
>>>web.xml:
>>>
>>><!-- mapping for ActionServlet -->
>>><servlet-mapping>
>>> <servlet-name>action</servlet-name>
>>> <url-pattern>/do/*</url-pattern>
>>></servlet-mapping>
>>>
>>>Quoting "Ruth, Brice" <br...@fiskars.com>:
>>>
>>> 
>>>
>>>      
>>>
>>>>How do you go about enabling path mapping v. extension mapping in 
>>>>web.xml (or struts-config.xml)?
>>>>
>>>>James Mitchell wrote:
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>>>First of all, you should never have to put ".do" any where in your
>>>>>application except the web.xml file.
>>>>>That way, you change the mapping in one place and it flows 
>>>>>          
>>>>>
>>to the rest
>>    
>>
>>>>>of the application.
>>>>>
>>>>>Here's what I do:
>>>>>
>>>>>
>>>>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
>>>>><%@ taglib uri="/WEB-INF/struts-html.tld"      prefix="html" %>
>>>>><%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
>>>>>
>>>>>
>>>>><jsp:useBean id="userDetailLink" class="java.util.HashMap"/>
>>>>>
>>>>><c:set target="${userDetailLink}" property="action" 
>>>>>          
>>>>>
>>value="editUser"/>
>>    
>>
>>>>><c:set target="${userDetailLink}" property="id" 
>>>>>          
>>>>>
>>value="${user.id}"/>
>>    
>>
>>>>><html:link action="/manageUsers" name="userDetailLink">
>>>>>	Edit this user
>>>>></html:link>
>>>>>
>>>>>
>>>>>
>>>>>Which produces a link like this:
>>>>>
>>>>><a 
>>>>>          
>>>>>
>>href="/app/admin-tool/manageUsers?action=editUser&amp;id=44">Edit
>>    
>>
>>>>>this user</a>
>>>>>
>>>>>
>>>>>The above example uses path mapping, but if I were using extension
>>>>>mapping (*.do), it looks like this:
>>>>>
>>>>>(with no changes to the source jsp)
>>>>>
>>>>><a href="/app/manageUsers.do?action=editUser&amp;id=44">Edit this
>>>>>user</a>
>>>>>
>>>>>
>>>>>
>>>>>--
>>>>>James Mitchell
>>>>>Software Engineer / Struts Evangelist
>>>>>http://www.struts-atlanta.org
>>>>>678.910.8017 (c)
>>>>>770.822.3359 (h)
>>>>>AIM:jmitchtx
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>>>-----Original Message-----
>>>>>>From: javen fang [mailto:fajaven2000@yahoo.com.cn] 
>>>>>>Sent: Friday, October 31, 2003 1:58 AM
>>>>>>To: struts
>>>>>>Subject: use html:link pass two param
>>>>>>
>>>>>>
>>>>>>I have a bean list that have two property id / name
>>>>>>
>>>>>>code:
>>>>>>------------------------------------------------------
>>>>>>
>>>>>><html:link action="next.do" paramId="first"
>>>>>>paramName="list" paramProperty="id"> next action
>>>>>></html:link>
>>>>>>
>>>>>>------------------------------------------------------
>>>>>>
>>>>>>
>>>>>>And how can I pass the second parameter name after the
>>>>>>action next.do??
>>>>>>Thanks.
>>>>>>
>>>>>>
>>>>>>
>>>>>>__________________________________________________
>>>>>>Do You Yahoo!?
>>>>>>Tired of spam?  Yahoo! Mail has the best spam protection around 
>>>>>>http://mail.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
>>    
>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>-- 
>>>>Brice D. Ruth
>>>>Sr. IT Analyst
>>>>Fiskars Brands, Inc.
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>
>>-- 
>>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
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>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


RE: use html:link pass two param

Posted by James Mitchell <jm...@apache.org>.
See Section 11.2 of the Servlet 2.3 API Specification or Section 10.2 of
the Servet 2.2 API Specification.

Then "do" some testing....pun intended ;)



--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017 (c)
770.822.3359 (h)
AIM:jmitchtx




> -----Original Message-----
> From: Ruth, Brice [mailto:bruth@fiskars.com] 
> Sent: Friday, October 31, 2003 11:03 AM
> To: Struts Users Mailing List
> Subject: Re: use html:link pass two param
> 
> 
> doesn't this still put 'do' somewhere in the URL?
> 
> Kris Schneider wrote:
> 
> >web.xml:
> >
> ><!-- mapping for ActionServlet -->
> ><servlet-mapping>
> >  <servlet-name>action</servlet-name>
> >  <url-pattern>/do/*</url-pattern>
> ></servlet-mapping>
> >
> >Quoting "Ruth, Brice" <br...@fiskars.com>:
> >
> >  
> >
> >>How do you go about enabling path mapping v. extension mapping in 
> >>web.xml (or struts-config.xml)?
> >>
> >>James Mitchell wrote:
> >>
> >>    
> >>
> >>>First of all, you should never have to put ".do" any where in your
> >>>application except the web.xml file.
> >>>That way, you change the mapping in one place and it flows 
> to the rest
> >>>of the application.
> >>>
> >>>Here's what I do:
> >>>
> >>>
> >>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
> >>><%@ taglib uri="/WEB-INF/struts-html.tld"      prefix="html" %>
> >>><%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
> >>>
> >>>
> >>><jsp:useBean id="userDetailLink" class="java.util.HashMap"/>
> >>>
> >>><c:set target="${userDetailLink}" property="action" 
> value="editUser"/>
> >>><c:set target="${userDetailLink}" property="id" 
> value="${user.id}"/>
> >>>
> >>><html:link action="/manageUsers" name="userDetailLink">
> >>>	Edit this user
> >>></html:link>
> >>>
> >>>
> >>>
> >>>Which produces a link like this:
> >>>
> >>><a 
> href="/app/admin-tool/manageUsers?action=editUser&amp;id=44">Edit
> >>>this user</a>
> >>>
> >>>
> >>>The above example uses path mapping, but if I were using extension
> >>>mapping (*.do), it looks like this:
> >>>
> >>>(with no changes to the source jsp)
> >>>
> >>><a href="/app/manageUsers.do?action=editUser&amp;id=44">Edit this
> >>>user</a>
> >>>
> >>>
> >>>
> >>>--
> >>>James Mitchell
> >>>Software Engineer / Struts Evangelist
> >>>http://www.struts-atlanta.org
> >>>678.910.8017 (c)
> >>>770.822.3359 (h)
> >>>AIM:jmitchtx
> >>>
> >>>
> >>>
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>>>-----Original Message-----
> >>>>From: javen fang [mailto:fajaven2000@yahoo.com.cn] 
> >>>>Sent: Friday, October 31, 2003 1:58 AM
> >>>>To: struts
> >>>>Subject: use html:link pass two param
> >>>>
> >>>>
> >>>>I have a bean list that have two property id / name
> >>>>
> >>>>code:
> >>>>------------------------------------------------------
> >>>>
> >>>><html:link action="next.do" paramId="first"
> >>>>paramName="list" paramProperty="id"> next action
> >>>></html:link>
> >>>>
> >>>>------------------------------------------------------
> >>>>
> >>>>
> >>>>And how can I pass the second parameter name after the
> >>>>action next.do??
> >>>>Thanks.
> >>>>
> >>>>
> >>>>
> >>>>__________________________________________________
> >>>>Do You Yahoo!?
> >>>>Tired of spam?  Yahoo! Mail has the best spam protection around 
> >>>>http://mail.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
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>-- 
> >>Brice D. Ruth
> >>Sr. IT Analyst
> >>Fiskars Brands, Inc.
> >>    
> >>
> >
> >  
> >
> 
> -- 
> 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
> 


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


Re: use html:link pass two param

Posted by "Ruth, Brice" <br...@fiskars.com>.
doesn't this still put 'do' somewhere in the URL?

Kris Schneider wrote:

>web.xml:
>
><!-- mapping for ActionServlet -->
><servlet-mapping>
>  <servlet-name>action</servlet-name>
>  <url-pattern>/do/*</url-pattern>
></servlet-mapping>
>
>Quoting "Ruth, Brice" <br...@fiskars.com>:
>
>  
>
>>How do you go about enabling path mapping v. extension mapping in 
>>web.xml (or struts-config.xml)?
>>
>>James Mitchell wrote:
>>
>>    
>>
>>>First of all, you should never have to put ".do" any where in your
>>>application except the web.xml file.
>>>That way, you change the mapping in one place and it flows to the rest
>>>of the application.
>>>
>>>Here's what I do:
>>>
>>>
>>><%@ page contentType="text/html;charset=UTF-8" language="java" %>
>>><%@ taglib uri="/WEB-INF/struts-html.tld"      prefix="html" %>
>>><%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
>>>
>>>
>>><jsp:useBean id="userDetailLink" class="java.util.HashMap"/>
>>>
>>><c:set target="${userDetailLink}" property="action" value="editUser"/>
>>><c:set target="${userDetailLink}" property="id" value="${user.id}"/>
>>>
>>><html:link action="/manageUsers" name="userDetailLink">
>>>	Edit this user
>>></html:link>
>>>
>>>
>>>
>>>Which produces a link like this:
>>>
>>><a href="/app/admin-tool/manageUsers?action=editUser&amp;id=44">Edit
>>>this user</a>
>>>
>>>
>>>The above example uses path mapping, but if I were using extension
>>>mapping (*.do), it looks like this:
>>>
>>>(with no changes to the source jsp)
>>>
>>><a href="/app/manageUsers.do?action=editUser&amp;id=44">Edit this
>>>user</a>
>>>
>>>
>>>
>>>--
>>>James Mitchell
>>>Software Engineer / Struts Evangelist
>>>http://www.struts-atlanta.org
>>>678.910.8017 (c)
>>>770.822.3359 (h)
>>>AIM:jmitchtx
>>>
>>>
>>>
>>>
>>> 
>>>
>>>      
>>>
>>>>-----Original Message-----
>>>>From: javen fang [mailto:fajaven2000@yahoo.com.cn] 
>>>>Sent: Friday, October 31, 2003 1:58 AM
>>>>To: struts
>>>>Subject: use html:link pass two param
>>>>
>>>>
>>>>I have a bean list that have two property id / name
>>>>
>>>>code:
>>>>------------------------------------------------------
>>>>
>>>><html:link action="next.do" paramId="first"
>>>>paramName="list" paramProperty="id"> next action
>>>></html:link>
>>>>
>>>>------------------------------------------------------
>>>>
>>>>
>>>>And how can I pass the second parameter name after the
>>>>action next.do??
>>>>Thanks.
>>>>
>>>>
>>>>
>>>>__________________________________________________
>>>>Do You Yahoo!?
>>>>Tired of spam?  Yahoo! Mail has the best spam protection around 
>>>>http://mail.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
>>>
>>> 
>>>
>>>      
>>>
>>-- 
>>Brice D. Ruth
>>Sr. IT Analyst
>>Fiskars Brands, Inc.
>>    
>>
>
>  
>

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


Re: use html:link pass two param

Posted by Kris Schneider <kr...@dotech.com>.
web.xml:

<!-- mapping for ActionServlet -->
<servlet-mapping>
  <servlet-name>action</servlet-name>
  <url-pattern>/do/*</url-pattern>
</servlet-mapping>

Quoting "Ruth, Brice" <br...@fiskars.com>:

> How do you go about enabling path mapping v. extension mapping in 
> web.xml (or struts-config.xml)?
> 
> James Mitchell wrote:
> 
> >First of all, you should never have to put ".do" any where in your
> >application except the web.xml file.
> >That way, you change the mapping in one place and it flows to the rest
> >of the application.
> >
> >Here's what I do:
> >
> >
> ><%@ page contentType="text/html;charset=UTF-8" language="java" %>
> ><%@ taglib uri="/WEB-INF/struts-html.tld"      prefix="html" %>
> ><%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
> >
> >
> ><jsp:useBean id="userDetailLink" class="java.util.HashMap"/>
> >
> ><c:set target="${userDetailLink}" property="action" value="editUser"/>
> ><c:set target="${userDetailLink}" property="id" value="${user.id}"/>
> >
> ><html:link action="/manageUsers" name="userDetailLink">
> >	Edit this user
> ></html:link>
> >
> >
> >
> >Which produces a link like this:
> >
> ><a href="/app/admin-tool/manageUsers?action=editUser&amp;id=44">Edit
> >this user</a>
> >
> >
> >The above example uses path mapping, but if I were using extension
> >mapping (*.do), it looks like this:
> >
> >(with no changes to the source jsp)
> >
> ><a href="/app/manageUsers.do?action=editUser&amp;id=44">Edit this
> >user</a>
> >
> >
> >
> >--
> >James Mitchell
> >Software Engineer / Struts Evangelist
> >http://www.struts-atlanta.org
> >678.910.8017 (c)
> >770.822.3359 (h)
> >AIM:jmitchtx
> >
> >
> >
> >
> >  
> >
> >>-----Original Message-----
> >>From: javen fang [mailto:fajaven2000@yahoo.com.cn] 
> >>Sent: Friday, October 31, 2003 1:58 AM
> >>To: struts
> >>Subject: use html:link pass two param
> >>
> >>
> >>I have a bean list that have two property id / name
> >>
> >>code:
> >>------------------------------------------------------
> >>
> >><html:link action="next.do" paramId="first"
> >>paramName="list" paramProperty="id"> next action
> >></html:link>
> >>
> >>------------------------------------------------------
> >>
> >>
> >>And how can I pass the second parameter name after the
> >>action next.do??
> >>Thanks.
> >>
> >>
> >>
> >>__________________________________________________
> >>Do You Yahoo!?
> >>Tired of spam?  Yahoo! Mail has the best spam protection around 
> >>http://mail.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
> >
> >  
> >
> 
> -- 
> Brice D. Ruth
> Sr. IT Analyst
> Fiskars Brands, Inc.

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

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


Re: use html:link pass two param

Posted by "Ruth, Brice" <br...@fiskars.com>.
How do you go about enabling path mapping v. extension mapping in 
web.xml (or struts-config.xml)?

James Mitchell wrote:

>First of all, you should never have to put ".do" any where in your
>application except the web.xml file.
>That way, you change the mapping in one place and it flows to the rest
>of the application.
>
>Here's what I do:
>
>
><%@ page contentType="text/html;charset=UTF-8" language="java" %>
><%@ taglib uri="/WEB-INF/struts-html.tld"      prefix="html" %>
><%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
>
>
><jsp:useBean id="userDetailLink" class="java.util.HashMap"/>
>
><c:set target="${userDetailLink}" property="action" value="editUser"/>
><c:set target="${userDetailLink}" property="id" value="${user.id}"/>
>
><html:link action="/manageUsers" name="userDetailLink">
>	Edit this user
></html:link>
>
>
>
>Which produces a link like this:
>
><a href="/app/admin-tool/manageUsers?action=editUser&amp;id=44">Edit
>this user</a>
>
>
>The above example uses path mapping, but if I were using extension
>mapping (*.do), it looks like this:
>
>(with no changes to the source jsp)
>
><a href="/app/manageUsers.do?action=editUser&amp;id=44">Edit this
>user</a>
>
>
>
>--
>James Mitchell
>Software Engineer / Struts Evangelist
>http://www.struts-atlanta.org
>678.910.8017 (c)
>770.822.3359 (h)
>AIM:jmitchtx
>
>
>
>
>  
>
>>-----Original Message-----
>>From: javen fang [mailto:fajaven2000@yahoo.com.cn] 
>>Sent: Friday, October 31, 2003 1:58 AM
>>To: struts
>>Subject: use html:link pass two param
>>
>>
>>I have a bean list that have two property id / name
>>
>>code:
>>------------------------------------------------------
>>
>><html:link action="next.do" paramId="first"
>>paramName="list" paramProperty="id"> next action
>></html:link>
>>
>>------------------------------------------------------
>>
>>
>>And how can I pass the second parameter name after the
>>action next.do??
>>Thanks.
>>
>>
>>
>>__________________________________________________
>>Do You Yahoo!?
>>Tired of spam?  Yahoo! Mail has the best spam protection around 
>>http://mail.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
>
>  
>

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


RE: use html:link pass two param

Posted by James Mitchell <jm...@apache.org>.
First of all, you should never have to put ".do" any where in your
application except the web.xml file.
That way, you change the mapping in one place and it flows to the rest
of the application.

Here's what I do:


<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld"      prefix="html" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>


<jsp:useBean id="userDetailLink" class="java.util.HashMap"/>

<c:set target="${userDetailLink}" property="action" value="editUser"/>
<c:set target="${userDetailLink}" property="id" value="${user.id}"/>

<html:link action="/manageUsers" name="userDetailLink">
	Edit this user
</html:link>



Which produces a link like this:

<a href="/app/admin-tool/manageUsers?action=editUser&amp;id=44">Edit
this user</a>


The above example uses path mapping, but if I were using extension
mapping (*.do), it looks like this:

(with no changes to the source jsp)

<a href="/app/manageUsers.do?action=editUser&amp;id=44">Edit this
user</a>



--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017 (c)
770.822.3359 (h)
AIM:jmitchtx




> -----Original Message-----
> From: javen fang [mailto:fajaven2000@yahoo.com.cn] 
> Sent: Friday, October 31, 2003 1:58 AM
> To: struts
> Subject: use html:link pass two param
> 
> 
> I have a bean list that have two property id / name
> 
> code:
> ------------------------------------------------------
> 
> <html:link action="next.do" paramId="first"
> paramName="list" paramProperty="id"> next action
> </html:link>
> 
> ------------------------------------------------------
> 
> 
> And how can I pass the second parameter name after the
> action next.do??
> Thanks.
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.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