You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Steven Nakhla <sd...@yahoo.com> on 2003/12/15 16:21:36 UTC
URLs & Parameters
I'm writing a simple web app, and am rather new to Struts. What I would like to do is have several HTML links in my page to perform different types of searches. For example,
<html:link href="/search.jsp?type=name">Name search</html:link>
<html:link href="/search.jsp?type=age">Age search</html:link>
<html:link href="/search.jsp?type=gender">Gender search</html:link>
In my search.jsp page, I'd like to be able to display form fields based on the type of search being performed. Is there any way to use, for example, one of the logic tags to get the value of "type" from the URL? Is there another way to accomplish this? Thanks very much in advance!
Steve Nakhla
---------------------------------
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing
Re: URLs & Parameters
Posted by Jim Theodoridis <st...@tera.gr>.
Hi!
The best soluion is to use an ActionForm to get the search criteria from the
user an then to usen an action an action to do the search dont use link
direct to jsp pages
----- Original Message -----
From: "Steven Nakhla" <sd...@yahoo.com>
To: "Struts" <st...@jakarta.apache.org>
Sent: Monday, December 15, 2003 5:21 PM
Subject: URLs & Parameters
> I'm writing a simple web app, and am rather new to Struts. What I would
like to do is have several HTML links in my page to perform different types
of searches. For example,
>
> <html:link href="/search.jsp?type=name">Name search</html:link>
> <html:link href="/search.jsp?type=age">Age search</html:link>
> <html:link href="/search.jsp?type=gender">Gender search</html:link>
>
> In my search.jsp page, I'd like to be able to display form fields based on
the type of search being performed. Is there any way to use, for example,
one of the logic tags to get the value of "type" from the URL? Is there
another way to accomplish this? Thanks very much in advance!
>
> Steve Nakhla
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: URLs & Parameters
Posted by Tim Lucia <ti...@yahoo.com>.
<logic:present parameter="type">
<logic:equal parameter="type" value="name">
</logic:equal>
<logic:equal parameter="type" value="age">
</logic:equal>
.
.
.
</logic:present>
I will assume you know you do not wish to use forms.
Tim Lucia
> -----Original Message-----
> From: Steven Nakhla [mailto:sdnakhla@yahoo.com]
> Sent: Monday, December 15, 2003 10:22 AM
> To: Struts
> Subject: URLs & Parameters
>
>
> I'm writing a simple web app, and am rather new to Struts.
> What I would like to do is have several HTML links in my page
> to perform different types of searches. For example,
>
> <html:link href="/search.jsp?type=name">Name
> search</html:link> <html:link href="/search.jsp?type=age">Age
> search</html:link> <html:link
> href="/search.jsp?type=gender">Gender search</html:link>
>
> In my search.jsp page, I'd like to be able to display form
> fields based on the type of search being performed. Is there
> any way to use, for example, one of the logic tags to get the
> value of "type" from the URL? Is there another way to
> accomplish this? Thanks very much in advance!
>
> Steve Nakhla
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org