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 2006/07/19 17:25:03 UTC

How to Pass a Textfield Value as a c:param to a Link using c:url?

I must have done someting wrong.

I tried to pass the value entered in a textfield:
<html-el:text property="searchFirstName" />

to a link this way:
<c:url value="/admin/sortUsers.do" var="ascFirstName">
    <c:param name="searchFirstName"
value="${searchFirstName}" />
</c:url>

and in my action class, I have
String firstName = request.getParameter(
"searchFirstName" );

I tried to print out the firstName, I got a blank!

Please advise what went wrong.

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

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


Re: Is there any direct link between model and view in struts..

Posted by Michael Jouravlev <jm...@gmail.com>.
On 7/20/06, sunil.prabhu <su...@exensys.com> wrote:
> Hi ,
>
>     Is there any direct link between model and view in struts Architecture?

If you are asking about something like automatically building input
forms or output pages based on business object's properties, then no,
Struts framework does not have such a feature. I believe there are
external projects that do that, like Appfuse. Another library,
FormDef, can build a dynaform based on properties of nested business
object, but this is not exactly what are you looking for, is it?

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


Is there any direct link between model and view in struts..

Posted by "sunil.prabhu" <su...@exensys.com>.
Hi ,

    Is there any direct link between model and view in struts Architecture?

Thanks and regards 
Sunil 




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


Re: How to Pass a Textfield Value as a c:param to a Link using c:url?

Posted by Michael Jouravlev <jm...@gmail.com>.
On 7/19/06, Laurie Harper <la...@holoweb.net> wrote:
> Michael Jouravlev wrote:
> > On 7/19/06, Caroline Jen <ji...@yahoo.com> wrote:
> >> My text field and the link are defined inside a HTML
> >> form
> > ....
> >> When I submit the form, the browser address bar shows
> >> searchFirstName=
> >>
> >> a blank is sent.
> >
> > You should start from here. Why does the browser send an emply
> > parameter? View HTML page source and verify that you have a <form> and
> > you have <input type="text" ...> inside of it. Try cutting that HTML
> > out, create a test HTML page and see how your browser submits the
> > form. Check generated request. The HTML form may not be properly
> > generated by JSP tags, but I don't know what exactly went wrong in
> > your JSP page.
>
> The problem is that c:url produces a link, not a form submit. You cannot
> capture the value entered into a text field and include it as a link
> parameter, except by writing some Javascript.

When I wrote this reply I got an impression that Caroline submits the
form first, then she displays the page with JSTL tags where she wants
to use submitted searchFirstName. But looks like this is not true, and
my first understanding about what she wanted to do (submitting the
form, generating URL on the fly) was in fact a correct one.

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


Re: How to Pass a Textfield Value as a c:param to a Link using c:url?

Posted by Laurie Harper <la...@holoweb.net>.
Michael Jouravlev wrote:
> On 7/19/06, Caroline Jen <ji...@yahoo.com> wrote:
>> My text field and the link are defined inside a HTML
>> form
> ....
>> When I submit the form, the browser address bar shows
>> searchFirstName=
>>
>> a blank is sent.
> 
> You should start from here. Why does the browser send an emply
> parameter? View HTML page source and verify that you have a <form> and
> you have <input type="text" ...> inside of it. Try cutting that HTML
> out, create a test HTML page and see how your browser submits the
> form. Check generated request. The HTML form may not be properly
> generated by JSP tags, but I don't know what exactly went wrong in
> your JSP page.

The problem is that c:url produces a link, not a form submit. You cannot 
capture the value entered into a text field and include it as a link 
parameter, except by writing some Javascript.

The c:url tag is processed on the server, as part of generating the HTML 
page. That happens *before* the user types anything into the text field. 
So anything subsequently entered into the text field is not going to be 
part of the link.

If you need the request to include form inputs, you need to generate 
that request via a form post. Use a submit button instead of the link.

L.


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


Re: How to Pass a Textfield Value as a c:param to a Link using c:url?

Posted by Michael Jouravlev <jm...@gmail.com>.
On 7/19/06, Caroline Jen <ji...@yahoo.com> wrote:
> My text field and the link are defined inside a HTML
> form
...
> When I submit the form, the browser address bar shows
> searchFirstName=
>
> a blank is sent.

You should start from here. Why does the browser send an emply
parameter? View HTML page source and verify that you have a <form> and
you have <input type="text" ...> inside of it. Try cutting that HTML
out, create a test HTML page and see how your browser submits the
form. Check generated request. The HTML form may not be properly
generated by JSP tags, but I don't know what exactly went wrong in
your JSP page.

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


Re: How to Pass a Textfield Value as a c:param to a Link using c:url?

Posted by Laurie Harper <la...@holoweb.net>.
You could always use html:image or html:button instead of c:url. That 
would allow you to generate a regular form input based submit image. Try 
thinking about how you would implement your form in HTML if you weren't 
using Struts, then look for the tags that support that design.

L.

Caroline Jen wrote:
> Thank all of you for support.
> 
> Now, it it an off-topic question.  
> 
> I am able to pass the fixed values using the
> <html-el:hidden ....> tag.  But, what is the
> Javascript like to submit value of a text field in the
> Struts context when a link is clicked.
> 
> It is difficult for me to get around the problem
> because my link is an image.
> 
> <c:url value="/admin/sortUsers.do" var="ascFirstName">
>     <c:param name="sortKey" value="firstName" />
>     <c:param name="orderKey" value="ASC" />
>     <c:param name="searchFirstName"
> value="${searchFirstName}" />
> </c:url>
> <A href=' <c:out value="${ascFirstName}" /> '>
> <html-el:img page="/images/upArrow.gif" border="0"
> alt="ascending" />
> </A>
> 
> -- Caroline
> 
> --- Michael Jouravlev <jm...@gmail.com> wrote:
> 
>> I suggest you rereading my very first answer. I can
>> add the following to it:
>>
>> * Clicking on a link, even if this link is defined
>> inside HTML form,
>> does not submit the form unless you write some
>> Javascript code to do
>> this.
>> * Even if your form were submitted with a link, the
>> link paramter
>> won't be populated with code like yours, because JSP
>> TAGS ARE
>> EVALUATED ON SERVER.
>>
>> If you want to submit a form with a link, you need
>> to write some
>> Javascript to do so. Or you can use a regular submit
>> button rendered
>> as a link (use CSS for that) and submit the form
>> with GET method.
>>
>> On 7/19/06, Caroline Jen <ji...@yahoo.com>
>> wrote:
>>> But, it does not work even I changed html-el to
>> html.
>>> In my link, I did pass some fixed values.  They
>> are
>>> picked up.  Let me explain:
>>> <c:url value="/admin/sortUsers.do"
>> var="ascFirstName">
>>>     <c:param name="sortKey" value="firstName" />
>>>     <c:param name="orderKey" value="ASC" />
>>>     <c:param name="searchFirstName"
>>> value="${searchFirstName}" />
>>> </c:url>
>>> <A href=' <c:out value="${ascFirstName}" /> '></A>
>>>
>>> The fixed values "firstName" and "ASC" are picked
>> up
>>> without problem.  But the "${searchFirstName}"
>> where
>>> searchFirstName is the property of a text field is
>> not
>>> picked up.
>>>
>>> --- David Friedman <hu...@ix.netcom.com> wrote:
>>>
>>>> Dear Caroline Jen,
>>>>
>>>> I thought people only used the "html-el" taglib
>>>> because their JSP container
>>>> didn't natively support EL?  That would mean
>> your
>>>> c:url and c:param tags
>>>> won't get the expressions ${searchFirstName} or
>>>> ${ascFirstName} parsed
>>>> because your JSP container doesn't do that.  If
>> your
>>>> container did parse
>>>> expression like that, you would be using the
>> regular
>>>> "html" taglib, right?
>>>> If I am missing something please let me know.  I
>>>> just cannot remember ever
>>>> hearing of any other reason to use the "html-el"
>>>> taglib - so this question
>>>> makes sense to me.
>>>>
>>>> Are you positive your final outputted html form
>>>> shows the url correctly
>>>> before you click on it?  Because if it were
>> blank
>>>> due to this EL non-parsing
>>>> issue it would explain why your
>>>> request.getParameter() method is returning
>>>> nothing.
>>>>
>>>> Regards,
>>>> David
>>>>
>>>> -----Original Message-----
>>>> From: Caroline Jen [mailto:jiapei_jen@yahoo.com]
>>>> Sent: Wednesday, July 19, 2006 12:51 PM
>>>> To: Struts Users Mailing List
>>>> Subject: Re: How to Pass a Textfield Value as a
>>>> c:param to a Link using
>>>> c:url?
>>>>
>>>>
>>>> My text field and the link are defined inside a
>> HTML
>>>> form and I do have the html-el and the JSTL tag
>>>> libraries.  Everything else worked fine except
>>>> passing
>>>> this text field value as a c:param via the c:url
>>>> link.
>>>>
>>>> When I submit the form, the browser address bar
>>>> shows
>>>> searchFirstName=
>>>>
>>>> a blank is sent.
>>>>
>>>> Let me post my code again.  I tried to pass the
>>>> value
>>>> entered in a textfield:
>>>>
>>>> <html-el:text property="searchFirstName" />
>>>>
>>>>
>>>> to a link this way:
>>>>
>>>> <c:url value="/admin/sortUsers.do"
>>>> var="ascFirstName">
>>>>     <c:param name="searchFirstName"
>>>> value="${searchFirstName}" />
>>>> </c:url>
>>>> <A href=' <c:out value="${ascFirstName}" />
>> '></A>
>>>> and in my action class, I have
>>>>
>>>> String firstName = request.getParameter(
>>>> "searchFirstName" );
>>>>
>>>>
>>>> I tried to print out the firstName in my action
>>>> class
>>>> using System.out.println( firstName); I got a
>> blank!
>>>>
>>>> --- Michael Jouravlev <jm...@gmail.com> wrote:
>>>>
>>>>> Make sure your text field is defined inside an
>>>> HTML
>>>>> form. Make sure
>>>>> you have proper taglib directives on top of
>> your
>>>> JSP
>>>>> page, for
>>>>> example, for html-el tags.
>>>>>
>>>>> Get an HTTP sniffer and see what is sent from
>>>>> browser when you submit
>>>>> a form. If you use Firefox, get Live HTTP
>> Header
>>>>> extension.
>>>>>
>>>>> On 7/19/06, Caroline Jen
>> <ji...@yahoo.com>
>>>>> wrote:
>>>>>> I am not talking about submit a JSP, perform
>>>> some
>>>>>> action, and return a JSP.
>>>>>>
>>>>>> I submit the textfield, and I used
>>>>> System.out.println
>>>>>> in my action class to write out the value
>>>>> submitted.
>>>>>> I got a blank.   Therefore, something must
>> go
>>>>> wrong.
>>>>>> --- Michael Jouravlev <jm...@gmail.com>
>> wrote:
>>>>>>> On 7/19/06, Caroline Jen
>>>> <ji...@yahoo.com>
>>>>>>> wrote:
>>>>>>>> I must have done someting wrong.
>>>>>>>>
>>>>>>>> I tried to pass the value entered in a
>>>>> textfield:
>>>>>>>> <html-el:text property="searchFirstName"
>> />
>>>>>>>> to a link this way:
>>>>>>>> <c:url value="/admin/sortUsers.do"
>>>>>>> var="ascFirstName">
>>>>>>>>     <c:param name="searchFirstName"
>>>>>>>> value="${searchFirstName}" />
>>>>>>>> </c:url>
>>>>>>>>
>>>>>>>> and in my action class, I have
>>>>>>>> String firstName = request.getParameter(
>>>>>>>> "searchFirstName" );
>>>>>>>>
>>>>>>>> I tried to print out the firstName, I
>> got a
>>>>> blank!
>>>>>>>> Please advise what went wrong.
>>>>>>> JSP tags are processed *on server*. For
>> your
>>>>> setup
>>>>>>> to work you need to
>>>>>>> submit a pag with <html-el:text
>>>>>>> property="searchFirstName" /> to the
> === message truncated ===
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 


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


Re: How to Pass a Textfield Value as a c:param to a Link using c:url?

Posted by Caroline Jen <ji...@yahoo.com>.
Thank all of you for support.

Now, it it an off-topic question.  

I am able to pass the fixed values using the
<html-el:hidden ....> tag.  But, what is the
Javascript like to submit value of a text field in the
Struts context when a link is clicked.

It is difficult for me to get around the problem
because my link is an image.

<c:url value="/admin/sortUsers.do" var="ascFirstName">
    <c:param name="sortKey" value="firstName" />
    <c:param name="orderKey" value="ASC" />
    <c:param name="searchFirstName"
value="${searchFirstName}" />
</c:url>
<A href=' <c:out value="${ascFirstName}" /> '>
<html-el:img page="/images/upArrow.gif" border="0"
alt="ascending" />
</A>

-- Caroline

--- Michael Jouravlev <jm...@gmail.com> wrote:

> I suggest you rereading my very first answer. I can
> add the following to it:
> 
> * Clicking on a link, even if this link is defined
> inside HTML form,
> does not submit the form unless you write some
> Javascript code to do
> this.
> * Even if your form were submitted with a link, the
> link paramter
> won't be populated with code like yours, because JSP
> TAGS ARE
> EVALUATED ON SERVER.
> 
> If you want to submit a form with a link, you need
> to write some
> Javascript to do so. Or you can use a regular submit
> button rendered
> as a link (use CSS for that) and submit the form
> with GET method.
> 
> On 7/19/06, Caroline Jen <ji...@yahoo.com>
> wrote:
> > But, it does not work even I changed html-el to
> html.
> >
> > In my link, I did pass some fixed values.  They
> are
> > picked up.  Let me explain:
> > <c:url value="/admin/sortUsers.do"
> var="ascFirstName">
> >     <c:param name="sortKey" value="firstName" />
> >     <c:param name="orderKey" value="ASC" />
> >     <c:param name="searchFirstName"
> > value="${searchFirstName}" />
> > </c:url>
> > <A href=' <c:out value="${ascFirstName}" /> '></A>
> >
> > The fixed values "firstName" and "ASC" are picked
> up
> > without problem.  But the "${searchFirstName}"
> where
> > searchFirstName is the property of a text field is
> not
> > picked up.
> >
> > --- David Friedman <hu...@ix.netcom.com> wrote:
> >
> > > Dear Caroline Jen,
> > >
> > > I thought people only used the "html-el" taglib
> > > because their JSP container
> > > didn't natively support EL?  That would mean
> your
> > > c:url and c:param tags
> > > won't get the expressions ${searchFirstName} or
> > > ${ascFirstName} parsed
> > > because your JSP container doesn't do that.  If
> your
> > > container did parse
> > > expression like that, you would be using the
> regular
> > > "html" taglib, right?
> > > If I am missing something please let me know.  I
> > > just cannot remember ever
> > > hearing of any other reason to use the "html-el"
> > > taglib - so this question
> > > makes sense to me.
> > >
> > > Are you positive your final outputted html form
> > > shows the url correctly
> > > before you click on it?  Because if it were
> blank
> > > due to this EL non-parsing
> > > issue it would explain why your
> > > request.getParameter() method is returning
> > > nothing.
> > >
> > > Regards,
> > > David
> > >
> > > -----Original Message-----
> > > From: Caroline Jen [mailto:jiapei_jen@yahoo.com]
> > > Sent: Wednesday, July 19, 2006 12:51 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: How to Pass a Textfield Value as a
> > > c:param to a Link using
> > > c:url?
> > >
> > >
> > > My text field and the link are defined inside a
> HTML
> > > form and I do have the html-el and the JSTL tag
> > > libraries.  Everything else worked fine except
> > > passing
> > > this text field value as a c:param via the c:url
> > > link.
> > >
> > > When I submit the form, the browser address bar
> > > shows
> > > searchFirstName=
> > >
> > > a blank is sent.
> > >
> > > Let me post my code again.  I tried to pass the
> > > value
> > > entered in a textfield:
> > >
> > > <html-el:text property="searchFirstName" />
> > >
> > >
> > > to a link this way:
> > >
> > > <c:url value="/admin/sortUsers.do"
> > > var="ascFirstName">
> > >     <c:param name="searchFirstName"
> > > value="${searchFirstName}" />
> > > </c:url>
> > > <A href=' <c:out value="${ascFirstName}" />
> '></A>
> > >
> > > and in my action class, I have
> > >
> > > String firstName = request.getParameter(
> > > "searchFirstName" );
> > >
> > >
> > > I tried to print out the firstName in my action
> > > class
> > > using System.out.println( firstName); I got a
> blank!
> > >
> > >
> > > --- Michael Jouravlev <jm...@gmail.com> wrote:
> > >
> > > > Make sure your text field is defined inside an
> > > HTML
> > > > form. Make sure
> > > > you have proper taglib directives on top of
> your
> > > JSP
> > > > page, for
> > > > example, for html-el tags.
> > > >
> > > > Get an HTTP sniffer and see what is sent from
> > > > browser when you submit
> > > > a form. If you use Firefox, get Live HTTP
> Header
> > > > extension.
> > > >
> > > > On 7/19/06, Caroline Jen
> <ji...@yahoo.com>
> > > > wrote:
> > > > > I am not talking about submit a JSP, perform
> > > some
> > > > > action, and return a JSP.
> > > > >
> > > > > I submit the textfield, and I used
> > > > System.out.println
> > > > > in my action class to write out the value
> > > > submitted.
> > > > > I got a blank.   Therefore, something must
> go
> > > > wrong.
> > > > >
> > > > > --- Michael Jouravlev <jm...@gmail.com>
> wrote:
> > > > >
> > > > > > On 7/19/06, Caroline Jen
> > > <ji...@yahoo.com>
> > > > > > wrote:
> > > > > > > I must have done someting wrong.
> > > > > > >
> > > > > > > I tried to pass the value entered in a
> > > > textfield:
> > > > > > > <html-el:text property="searchFirstName"
> />
> > > > > > >
> > > > > > > to a link this way:
> > > > > > > <c:url value="/admin/sortUsers.do"
> > > > > > var="ascFirstName">
> > > > > > >     <c:param name="searchFirstName"
> > > > > > > value="${searchFirstName}" />
> > > > > > > </c:url>
> > > > > > >
> > > > > > > and in my action class, I have
> > > > > > > String firstName = request.getParameter(
> > > > > > > "searchFirstName" );
> > > > > > >
> > > > > > > I tried to print out the firstName, I
> got a
> > > > blank!
> > > > > > >
> > > > > > > Please advise what went wrong.
> > > > > >
> > > > > > JSP tags are processed *on server*. For
> your
> > > > setup
> > > > > > to work you need to
> > > > > > submit a pag with <html-el:text
> > > > > > property="searchFirstName" /> to the
> 
=== message truncated ===


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

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


Re: How to Pass a Textfield Value as a c:param to a Link using c:url?

Posted by Michael Jouravlev <jm...@gmail.com>.
I suggest you rereading my very first answer. I can add the following to it:

* Clicking on a link, even if this link is defined inside HTML form,
does not submit the form unless you write some Javascript code to do
this.
* Even if your form were submitted with a link, the link paramter
won't be populated with code like yours, because JSP TAGS ARE
EVALUATED ON SERVER.

If you want to submit a form with a link, you need to write some
Javascript to do so. Or you can use a regular submit button rendered
as a link (use CSS for that) and submit the form with GET method.

On 7/19/06, Caroline Jen <ji...@yahoo.com> wrote:
> But, it does not work even I changed html-el to html.
>
> In my link, I did pass some fixed values.  They are
> picked up.  Let me explain:
> <c:url value="/admin/sortUsers.do" var="ascFirstName">
>     <c:param name="sortKey" value="firstName" />
>     <c:param name="orderKey" value="ASC" />
>     <c:param name="searchFirstName"
> value="${searchFirstName}" />
> </c:url>
> <A href=' <c:out value="${ascFirstName}" /> '></A>
>
> The fixed values "firstName" and "ASC" are picked up
> without problem.  But the "${searchFirstName}" where
> searchFirstName is the property of a text field is not
> picked up.
>
> --- David Friedman <hu...@ix.netcom.com> wrote:
>
> > Dear Caroline Jen,
> >
> > I thought people only used the "html-el" taglib
> > because their JSP container
> > didn't natively support EL?  That would mean your
> > c:url and c:param tags
> > won't get the expressions ${searchFirstName} or
> > ${ascFirstName} parsed
> > because your JSP container doesn't do that.  If your
> > container did parse
> > expression like that, you would be using the regular
> > "html" taglib, right?
> > If I am missing something please let me know.  I
> > just cannot remember ever
> > hearing of any other reason to use the "html-el"
> > taglib - so this question
> > makes sense to me.
> >
> > Are you positive your final outputted html form
> > shows the url correctly
> > before you click on it?  Because if it were blank
> > due to this EL non-parsing
> > issue it would explain why your
> > request.getParameter() method is returning
> > nothing.
> >
> > Regards,
> > David
> >
> > -----Original Message-----
> > From: Caroline Jen [mailto:jiapei_jen@yahoo.com]
> > Sent: Wednesday, July 19, 2006 12:51 PM
> > To: Struts Users Mailing List
> > Subject: Re: How to Pass a Textfield Value as a
> > c:param to a Link using
> > c:url?
> >
> >
> > My text field and the link are defined inside a HTML
> > form and I do have the html-el and the JSTL tag
> > libraries.  Everything else worked fine except
> > passing
> > this text field value as a c:param via the c:url
> > link.
> >
> > When I submit the form, the browser address bar
> > shows
> > searchFirstName=
> >
> > a blank is sent.
> >
> > Let me post my code again.  I tried to pass the
> > value
> > entered in a textfield:
> >
> > <html-el:text property="searchFirstName" />
> >
> >
> > to a link this way:
> >
> > <c:url value="/admin/sortUsers.do"
> > var="ascFirstName">
> >     <c:param name="searchFirstName"
> > value="${searchFirstName}" />
> > </c:url>
> > <A href=' <c:out value="${ascFirstName}" /> '></A>
> >
> > and in my action class, I have
> >
> > String firstName = request.getParameter(
> > "searchFirstName" );
> >
> >
> > I tried to print out the firstName in my action
> > class
> > using System.out.println( firstName); I got a blank!
> >
> >
> > --- Michael Jouravlev <jm...@gmail.com> wrote:
> >
> > > Make sure your text field is defined inside an
> > HTML
> > > form. Make sure
> > > you have proper taglib directives on top of your
> > JSP
> > > page, for
> > > example, for html-el tags.
> > >
> > > Get an HTTP sniffer and see what is sent from
> > > browser when you submit
> > > a form. If you use Firefox, get Live HTTP Header
> > > extension.
> > >
> > > On 7/19/06, Caroline Jen <ji...@yahoo.com>
> > > wrote:
> > > > I am not talking about submit a JSP, perform
> > some
> > > > action, and return a JSP.
> > > >
> > > > I submit the textfield, and I used
> > > System.out.println
> > > > in my action class to write out the value
> > > submitted.
> > > > I got a blank.   Therefore, something must go
> > > wrong.
> > > >
> > > > --- Michael Jouravlev <jm...@gmail.com> wrote:
> > > >
> > > > > On 7/19/06, Caroline Jen
> > <ji...@yahoo.com>
> > > > > wrote:
> > > > > > I must have done someting wrong.
> > > > > >
> > > > > > I tried to pass the value entered in a
> > > textfield:
> > > > > > <html-el:text property="searchFirstName" />
> > > > > >
> > > > > > to a link this way:
> > > > > > <c:url value="/admin/sortUsers.do"
> > > > > var="ascFirstName">
> > > > > >     <c:param name="searchFirstName"
> > > > > > value="${searchFirstName}" />
> > > > > > </c:url>
> > > > > >
> > > > > > and in my action class, I have
> > > > > > String firstName = request.getParameter(
> > > > > > "searchFirstName" );
> > > > > >
> > > > > > I tried to print out the firstName, I got a
> > > blank!
> > > > > >
> > > > > > Please advise what went wrong.
> > > > >
> > > > > JSP tags are processed *on server*. For your
> > > setup
> > > > > to work you need to
> > > > > submit a pag with <html-el:text
> > > > > property="searchFirstName" /> to the
> > > > > server first, read value from request
> > parameter
> > > and
> > > > > stick it into
> > > > > appropriate scope under "searchFirstName"
> > name.
> > > > >
> > > > > Then, when you forward to JSP from your
> > action,
> > > > > JSP/servlet engine
> > > > > will process JSP tags, still *on server*. It
> > > will
> > > > > read
> > > > > "searchFirstName" from servlet scope and write
> > > out
> > > > > its value into
> > > > > generated HTML markup. Then resulting HTML
> > page
> > > will
> > > > > be sent to
> > > > > browser.
> > > > >
> > > > > If you want to do the whole thing on client,
> > use
> > > > > HTML form and submit
> > > > > it with GET method. This way form fields will
> > be
> > > > > appended to "action"
> > > > > URL, exactly as you wanted.

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


RE: How to Pass a Textfield Value as a c:param to a Link using c:url?

Posted by David Friedman <hu...@ix.netcom.com>.
Where does "searchFirstName" get defined?  If it is in your form when how
would c:url know what form or what field to use?  Also, have you tried
having your action set "searchFirstName" with something like this
request.setParameter("searchFirstName", someStringVar) so c:url could see it
as ${searchFirstName} in the url it is generating?  I guess I do not see how
it is supposed to know the field "searchFirstName" that the FORM that Struts
is using unless you give it the scope, bean name, and field name kind of
like: request.formdefname.searchFirstName.  Remember, the html: and html-el:
tags already know their form name to implicitly use because it is pulled
from the action path.  C:url isn't a struts tag so how would it know that
scope and form bean name to lookup to find the searchFirstName field?  I
hope this makes sense.

Regards,
David

-----Original Message-----
From: Caroline Jen [mailto:jiapei_jen@yahoo.com]
Sent: Wednesday, July 19, 2006 1:40 PM
To: Struts Users Mailing List
Subject: RE: How to Pass a Textfield Value as a c:param to a Link using
c:url?


But, it does not work even I changed html-el to html.

In my link, I did pass some fixed values.  They are
picked up.  Let me explain:
<c:url value="/admin/sortUsers.do" var="ascFirstName">
    <c:param name="sortKey" value="firstName" />
    <c:param name="orderKey" value="ASC" />
    <c:param name="searchFirstName"
value="${searchFirstName}" />
</c:url>
<A href=' <c:out value="${ascFirstName}" /> '></A>

The fixed values "firstName" and "ASC" are picked up
without problem.  But the "${searchFirstName}" where
searchFirstName is the property of a text field is not
picked up.

--- David Friedman <hu...@ix.netcom.com> wrote:

> Dear Caroline Jen,
>
> I thought people only used the "html-el" taglib
> because their JSP container
> didn't natively support EL?  That would mean your
> c:url and c:param tags
> won't get the expressions ${searchFirstName} or
> ${ascFirstName} parsed
> because your JSP container doesn't do that.  If your
> container did parse
> expression like that, you would be using the regular
> "html" taglib, right?
> If I am missing something please let me know.  I
> just cannot remember ever
> hearing of any other reason to use the "html-el"
> taglib - so this question
> makes sense to me.
>
> Are you positive your final outputted html form
> shows the url correctly
> before you click on it?  Because if it were blank
> due to this EL non-parsing
> issue it would explain why your
> request.getParameter() method is returning
> nothing.
>
> Regards,
> David
>
> -----Original Message-----
> From: Caroline Jen [mailto:jiapei_jen@yahoo.com]
> Sent: Wednesday, July 19, 2006 12:51 PM
> To: Struts Users Mailing List
> Subject: Re: How to Pass a Textfield Value as a
> c:param to a Link using
> c:url?
>
>
> My text field and the link are defined inside a HTML
> form and I do have the html-el and the JSTL tag
> libraries.  Everything else worked fine except
> passing
> this text field value as a c:param via the c:url
> link.
>
> When I submit the form, the browser address bar
> shows
> searchFirstName=
>
> a blank is sent.
>
> Let me post my code again.  I tried to pass the
> value
> entered in a textfield:
>
> <html-el:text property="searchFirstName" />
>
>
> to a link this way:
>
> <c:url value="/admin/sortUsers.do"
> var="ascFirstName">
>     <c:param name="searchFirstName"
> value="${searchFirstName}" />
> </c:url>
> <A href=' <c:out value="${ascFirstName}" /> '></A>
>
> and in my action class, I have
>
> String firstName = request.getParameter(
> "searchFirstName" );
>
>
> I tried to print out the firstName in my action
> class
> using System.out.println( firstName); I got a blank!
>
>
> --- Michael Jouravlev <jm...@gmail.com> wrote:
>
> > Make sure your text field is defined inside an
> HTML
> > form. Make sure
> > you have proper taglib directives on top of your
> JSP
> > page, for
> > example, for html-el tags.
> >
> > Get an HTTP sniffer and see what is sent from
> > browser when you submit
> > a form. If you use Firefox, get Live HTTP Header
> > extension.
> >
> > On 7/19/06, Caroline Jen <ji...@yahoo.com>
> > wrote:
> > > I am not talking about submit a JSP, perform
> some
> > > action, and return a JSP.
> > >
> > > I submit the textfield, and I used
> > System.out.println
> > > in my action class to write out the value
> > submitted.
> > > I got a blank.   Therefore, something must go
> > wrong.
> > >
> > > --- Michael Jouravlev <jm...@gmail.com> wrote:
> > >
> > > > On 7/19/06, Caroline Jen
> <ji...@yahoo.com>
> > > > wrote:
> > > > > I must have done someting wrong.
> > > > >
> > > > > I tried to pass the value entered in a
> > textfield:
> > > > > <html-el:text property="searchFirstName" />
> > > > >
> > > > > to a link this way:
> > > > > <c:url value="/admin/sortUsers.do"
> > > > var="ascFirstName">
> > > > >     <c:param name="searchFirstName"
> > > > > value="${searchFirstName}" />
> > > > > </c:url>
> > > > >
> > > > > and in my action class, I have
> > > > > String firstName = request.getParameter(
> > > > > "searchFirstName" );
> > > > >
> > > > > I tried to print out the firstName, I got a
> > blank!
> > > > >
> > > > > Please advise what went wrong.
> > > >
> > > > JSP tags are processed *on server*. For your
> > setup
> > > > to work you need to
> > > > submit a pag with <html-el:text
> > > > property="searchFirstName" /> to the
> > > > server first, read value from request
> parameter
> > and
> > > > stick it into
> > > > appropriate scope under "searchFirstName"
> name.
> > > >
> > > > Then, when you forward to JSP from your
> action,
> > > > JSP/servlet engine
> > > > will process JSP tags, still *on server*. It
> > will
> > > > read
> > > > "searchFirstName" from servlet scope and write
> > out
> > > > its value into
> > > > generated HTML markup. Then resulting HTML
> page
> > will
> > > > be sent to
> > > > browser.
> > > >
> > > > If you want to do the whole thing on client,
> use
> > > > HTML form and submit
> > > > it with GET method. This way form fields will
> be
> > > > appended to "action"
> > > > URL, exactly as you wanted.
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
>
>


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

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


RE: How to Pass a Textfield Value as a c:param to a Link using c:url?

Posted by Caroline Jen <ji...@yahoo.com>.
But, it does not work even I changed html-el to html.

In my link, I did pass some fixed values.  They are
picked up.  Let me explain:
<c:url value="/admin/sortUsers.do" var="ascFirstName">
    <c:param name="sortKey" value="firstName" />
    <c:param name="orderKey" value="ASC" />
    <c:param name="searchFirstName"
value="${searchFirstName}" />
</c:url>
<A href=' <c:out value="${ascFirstName}" /> '></A>

The fixed values "firstName" and "ASC" are picked up
without problem.  But the "${searchFirstName}" where
searchFirstName is the property of a text field is not
picked up. 

--- David Friedman <hu...@ix.netcom.com> wrote:

> Dear Caroline Jen,
> 
> I thought people only used the "html-el" taglib
> because their JSP container
> didn't natively support EL?  That would mean your
> c:url and c:param tags
> won't get the expressions ${searchFirstName} or
> ${ascFirstName} parsed
> because your JSP container doesn't do that.  If your
> container did parse
> expression like that, you would be using the regular
> "html" taglib, right?
> If I am missing something please let me know.  I
> just cannot remember ever
> hearing of any other reason to use the "html-el"
> taglib - so this question
> makes sense to me.
> 
> Are you positive your final outputted html form
> shows the url correctly
> before you click on it?  Because if it were blank
> due to this EL non-parsing
> issue it would explain why your
> request.getParameter() method is returning
> nothing.
> 
> Regards,
> David
> 
> -----Original Message-----
> From: Caroline Jen [mailto:jiapei_jen@yahoo.com]
> Sent: Wednesday, July 19, 2006 12:51 PM
> To: Struts Users Mailing List
> Subject: Re: How to Pass a Textfield Value as a
> c:param to a Link using
> c:url?
> 
> 
> My text field and the link are defined inside a HTML
> form and I do have the html-el and the JSTL tag
> libraries.  Everything else worked fine except
> passing
> this text field value as a c:param via the c:url
> link.
> 
> When I submit the form, the browser address bar
> shows
> searchFirstName=
> 
> a blank is sent.
> 
> Let me post my code again.  I tried to pass the
> value
> entered in a textfield:
> 
> <html-el:text property="searchFirstName" />
> 
> 
> to a link this way:
> 
> <c:url value="/admin/sortUsers.do"
> var="ascFirstName">
>     <c:param name="searchFirstName"
> value="${searchFirstName}" />
> </c:url>
> <A href=' <c:out value="${ascFirstName}" /> '></A>
> 
> and in my action class, I have
> 
> String firstName = request.getParameter(
> "searchFirstName" );
> 
> 
> I tried to print out the firstName in my action
> class
> using System.out.println( firstName); I got a blank!
> 
> 
> --- Michael Jouravlev <jm...@gmail.com> wrote:
> 
> > Make sure your text field is defined inside an
> HTML
> > form. Make sure
> > you have proper taglib directives on top of your
> JSP
> > page, for
> > example, for html-el tags.
> >
> > Get an HTTP sniffer and see what is sent from
> > browser when you submit
> > a form. If you use Firefox, get Live HTTP Header
> > extension.
> >
> > On 7/19/06, Caroline Jen <ji...@yahoo.com>
> > wrote:
> > > I am not talking about submit a JSP, perform
> some
> > > action, and return a JSP.
> > >
> > > I submit the textfield, and I used
> > System.out.println
> > > in my action class to write out the value
> > submitted.
> > > I got a blank.   Therefore, something must go
> > wrong.
> > >
> > > --- Michael Jouravlev <jm...@gmail.com> wrote:
> > >
> > > > On 7/19/06, Caroline Jen
> <ji...@yahoo.com>
> > > > wrote:
> > > > > I must have done someting wrong.
> > > > >
> > > > > I tried to pass the value entered in a
> > textfield:
> > > > > <html-el:text property="searchFirstName" />
> > > > >
> > > > > to a link this way:
> > > > > <c:url value="/admin/sortUsers.do"
> > > > var="ascFirstName">
> > > > >     <c:param name="searchFirstName"
> > > > > value="${searchFirstName}" />
> > > > > </c:url>
> > > > >
> > > > > and in my action class, I have
> > > > > String firstName = request.getParameter(
> > > > > "searchFirstName" );
> > > > >
> > > > > I tried to print out the firstName, I got a
> > blank!
> > > > >
> > > > > Please advise what went wrong.
> > > >
> > > > JSP tags are processed *on server*. For your
> > setup
> > > > to work you need to
> > > > submit a pag with <html-el:text
> > > > property="searchFirstName" /> to the
> > > > server first, read value from request
> parameter
> > and
> > > > stick it into
> > > > appropriate scope under "searchFirstName"
> name.
> > > >
> > > > Then, when you forward to JSP from your
> action,
> > > > JSP/servlet engine
> > > > will process JSP tags, still *on server*. It
> > will
> > > > read
> > > > "searchFirstName" from servlet scope and write
> > out
> > > > its value into
> > > > generated HTML markup. Then resulting HTML
> page
> > will
> > > > be sent to
> > > > browser.
> > > >
> > > > If you want to do the whole thing on client,
> use
> > > > HTML form and submit
> > > > it with GET method. This way form fields will
> be
> > > > appended to "action"
> > > > URL, exactly as you wanted.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


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

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


RE: How to Pass a Textfield Value as a c:param to a Link using c:url?

Posted by David Friedman <hu...@ix.netcom.com>.
Dear Caroline Jen,

I thought people only used the "html-el" taglib because their JSP container
didn't natively support EL?  That would mean your c:url and c:param tags
won't get the expressions ${searchFirstName} or ${ascFirstName} parsed
because your JSP container doesn't do that.  If your container did parse
expression like that, you would be using the regular "html" taglib, right?
If I am missing something please let me know.  I just cannot remember ever
hearing of any other reason to use the "html-el" taglib - so this question
makes sense to me.

Are you positive your final outputted html form shows the url correctly
before you click on it?  Because if it were blank due to this EL non-parsing
issue it would explain why your request.getParameter() method is returning
nothing.

Regards,
David

-----Original Message-----
From: Caroline Jen [mailto:jiapei_jen@yahoo.com]
Sent: Wednesday, July 19, 2006 12:51 PM
To: Struts Users Mailing List
Subject: Re: How to Pass a Textfield Value as a c:param to a Link using
c:url?


My text field and the link are defined inside a HTML
form and I do have the html-el and the JSTL tag
libraries.  Everything else worked fine except passing
this text field value as a c:param via the c:url link.

When I submit the form, the browser address bar shows
searchFirstName=

a blank is sent.

Let me post my code again.  I tried to pass the value
entered in a textfield:

<html-el:text property="searchFirstName" />


to a link this way:

<c:url value="/admin/sortUsers.do" var="ascFirstName">
    <c:param name="searchFirstName"
value="${searchFirstName}" />
</c:url>
<A href=' <c:out value="${ascFirstName}" /> '></A>

and in my action class, I have

String firstName = request.getParameter(
"searchFirstName" );


I tried to print out the firstName in my action class
using System.out.println( firstName); I got a blank!


--- Michael Jouravlev <jm...@gmail.com> wrote:

> Make sure your text field is defined inside an HTML
> form. Make sure
> you have proper taglib directives on top of your JSP
> page, for
> example, for html-el tags.
>
> Get an HTTP sniffer and see what is sent from
> browser when you submit
> a form. If you use Firefox, get Live HTTP Header
> extension.
>
> On 7/19/06, Caroline Jen <ji...@yahoo.com>
> wrote:
> > I am not talking about submit a JSP, perform some
> > action, and return a JSP.
> >
> > I submit the textfield, and I used
> System.out.println
> > in my action class to write out the value
> submitted.
> > I got a blank.   Therefore, something must go
> wrong.
> >
> > --- Michael Jouravlev <jm...@gmail.com> wrote:
> >
> > > On 7/19/06, Caroline Jen <ji...@yahoo.com>
> > > wrote:
> > > > I must have done someting wrong.
> > > >
> > > > I tried to pass the value entered in a
> textfield:
> > > > <html-el:text property="searchFirstName" />
> > > >
> > > > to a link this way:
> > > > <c:url value="/admin/sortUsers.do"
> > > var="ascFirstName">
> > > >     <c:param name="searchFirstName"
> > > > value="${searchFirstName}" />
> > > > </c:url>
> > > >
> > > > and in my action class, I have
> > > > String firstName = request.getParameter(
> > > > "searchFirstName" );
> > > >
> > > > I tried to print out the firstName, I got a
> blank!
> > > >
> > > > Please advise what went wrong.
> > >
> > > JSP tags are processed *on server*. For your
> setup
> > > to work you need to
> > > submit a pag with <html-el:text
> > > property="searchFirstName" /> to the
> > > server first, read value from request parameter
> and
> > > stick it into
> > > appropriate scope under "searchFirstName" name.
> > >
> > > Then, when you forward to JSP from your action,
> > > JSP/servlet engine
> > > will process JSP tags, still *on server*. It
> will
> > > read
> > > "searchFirstName" from servlet scope and write
> out
> > > its value into
> > > generated HTML markup. Then resulting HTML page
> will
> > > be sent to
> > > browser.
> > >
> > > If you want to do the whole thing on client, use
> > > HTML form and submit
> > > it with GET method. This way form fields will be
> > > appended to "action"
> > > URL, exactly as you wanted.


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


Re: How to Pass a Textfield Value as a c:param to a Link using c:url?

Posted by Caroline Jen <ji...@yahoo.com>.
My text field and the link are defined inside a HTML
form and I do have the html-el and the JSTL tag
libraries.  Everything else worked fine except passing
this text field value as a c:param via the c:url link.

When I submit the form, the browser address bar shows
searchFirstName=

a blank is sent.

Let me post my code again.  I tried to pass the value
entered in a textfield:

<html-el:text property="searchFirstName" />


to a link this way:

<c:url value="/admin/sortUsers.do" var="ascFirstName">
    <c:param name="searchFirstName"
value="${searchFirstName}" />
</c:url>
<A href=' <c:out value="${ascFirstName}" /> '></A>

and in my action class, I have

String firstName = request.getParameter(
"searchFirstName" );


I tried to print out the firstName in my action class
using System.out.println( firstName); I got a blank!


--- Michael Jouravlev <jm...@gmail.com> wrote:

> Make sure your text field is defined inside an HTML
> form. Make sure
> you have proper taglib directives on top of your JSP
> page, for
> example, for html-el tags.
> 
> Get an HTTP sniffer and see what is sent from
> browser when you submit
> a form. If you use Firefox, get Live HTTP Header
> extension.
> 
> On 7/19/06, Caroline Jen <ji...@yahoo.com>
> wrote:
> > I am not talking about submit a JSP, perform some
> > action, and return a JSP.
> >
> > I submit the textfield, and I used
> System.out.println
> > in my action class to write out the value
> submitted.
> > I got a blank.   Therefore, something must go
> wrong.
> >
> > --- Michael Jouravlev <jm...@gmail.com> wrote:
> >
> > > On 7/19/06, Caroline Jen <ji...@yahoo.com>
> > > wrote:
> > > > I must have done someting wrong.
> > > >
> > > > I tried to pass the value entered in a
> textfield:
> > > > <html-el:text property="searchFirstName" />
> > > >
> > > > to a link this way:
> > > > <c:url value="/admin/sortUsers.do"
> > > var="ascFirstName">
> > > >     <c:param name="searchFirstName"
> > > > value="${searchFirstName}" />
> > > > </c:url>
> > > >
> > > > and in my action class, I have
> > > > String firstName = request.getParameter(
> > > > "searchFirstName" );
> > > >
> > > > I tried to print out the firstName, I got a
> blank!
> > > >
> > > > Please advise what went wrong.
> > >
> > > JSP tags are processed *on server*. For your
> setup
> > > to work you need to
> > > submit a pag with <html-el:text
> > > property="searchFirstName" /> to the
> > > server first, read value from request parameter
> and
> > > stick it into
> > > appropriate scope under "searchFirstName" name.
> > >
> > > Then, when you forward to JSP from your action,
> > > JSP/servlet engine
> > > will process JSP tags, still *on server*. It
> will
> > > read
> > > "searchFirstName" from servlet scope and write
> out
> > > its value into
> > > generated HTML markup. Then resulting HTML page
> will
> > > be sent to
> > > browser.
> > >
> > > If you want to do the whole thing on client, use
> > > HTML form and submit
> > > it with GET method. This way form fields will be
> > > appended to "action"
> > > URL, exactly as you wanted.
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > > user-help@struts.apache.org
> > >
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > 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
> 
> 


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

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


Re: How to Pass a Textfield Value as a c:param to a Link using c:url?

Posted by Michael Jouravlev <jm...@gmail.com>.
Make sure your text field is defined inside an HTML form. Make sure
you have proper taglib directives on top of your JSP page, for
example, for html-el tags.

Get an HTTP sniffer and see what is sent from browser when you submit
a form. If you use Firefox, get Live HTTP Header extension.

On 7/19/06, Caroline Jen <ji...@yahoo.com> wrote:
> I am not talking about submit a JSP, perform some
> action, and return a JSP.
>
> I submit the textfield, and I used System.out.println
> in my action class to write out the value submitted.
> I got a blank.   Therefore, something must go wrong.
>
> --- Michael Jouravlev <jm...@gmail.com> wrote:
>
> > On 7/19/06, Caroline Jen <ji...@yahoo.com>
> > wrote:
> > > I must have done someting wrong.
> > >
> > > I tried to pass the value entered in a textfield:
> > > <html-el:text property="searchFirstName" />
> > >
> > > to a link this way:
> > > <c:url value="/admin/sortUsers.do"
> > var="ascFirstName">
> > >     <c:param name="searchFirstName"
> > > value="${searchFirstName}" />
> > > </c:url>
> > >
> > > and in my action class, I have
> > > String firstName = request.getParameter(
> > > "searchFirstName" );
> > >
> > > I tried to print out the firstName, I got a blank!
> > >
> > > Please advise what went wrong.
> >
> > JSP tags are processed *on server*. For your setup
> > to work you need to
> > submit a pag with <html-el:text
> > property="searchFirstName" /> to the
> > server first, read value from request parameter and
> > stick it into
> > appropriate scope under "searchFirstName" name.
> >
> > Then, when you forward to JSP from your action,
> > JSP/servlet engine
> > will process JSP tags, still *on server*. It will
> > read
> > "searchFirstName" from servlet scope and write out
> > its value into
> > generated HTML markup. Then resulting HTML page will
> > be sent to
> > browser.
> >
> > If you want to do the whole thing on client, use
> > HTML form and submit
> > it with GET method. This way form fields will be
> > appended to "action"
> > URL, exactly as you wanted.
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> 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


Re: How to Pass a Textfield Value as a c:param to a Link using c:url?

Posted by Caroline Jen <ji...@yahoo.com>.
I am not talking about submit a JSP, perform some
action, and return a JSP.

I submit the textfield, and I used System.out.println
in my action class to write out the value submitted. 
I got a blank.   Therefore, something must go wrong.

--- Michael Jouravlev <jm...@gmail.com> wrote:

> On 7/19/06, Caroline Jen <ji...@yahoo.com>
> wrote:
> > I must have done someting wrong.
> >
> > I tried to pass the value entered in a textfield:
> > <html-el:text property="searchFirstName" />
> >
> > to a link this way:
> > <c:url value="/admin/sortUsers.do"
> var="ascFirstName">
> >     <c:param name="searchFirstName"
> > value="${searchFirstName}" />
> > </c:url>
> >
> > and in my action class, I have
> > String firstName = request.getParameter(
> > "searchFirstName" );
> >
> > I tried to print out the firstName, I got a blank!
> >
> > Please advise what went wrong.
> 
> JSP tags are processed *on server*. For your setup
> to work you need to
> submit a pag with <html-el:text
> property="searchFirstName" /> to the
> server first, read value from request parameter and
> stick it into
> appropriate scope under "searchFirstName" name.
> 
> Then, when you forward to JSP from your action,
> JSP/servlet engine
> will process JSP tags, still *on server*. It will
> read
> "searchFirstName" from servlet scope and write out
> its value into
> generated HTML markup. Then resulting HTML page will
> be sent to
> browser.
> 
> If you want to do the whole thing on client, use
> HTML form and submit
> it with GET method. This way form fields will be
> appended to "action"
> URL, exactly as you wanted.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


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

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


Re: How to Pass a Textfield Value as a c:param to a Link using c:url?

Posted by Michael Jouravlev <jm...@gmail.com>.
On 7/19/06, Caroline Jen <ji...@yahoo.com> wrote:
> I must have done someting wrong.
>
> I tried to pass the value entered in a textfield:
> <html-el:text property="searchFirstName" />
>
> to a link this way:
> <c:url value="/admin/sortUsers.do" var="ascFirstName">
>     <c:param name="searchFirstName"
> value="${searchFirstName}" />
> </c:url>
>
> and in my action class, I have
> String firstName = request.getParameter(
> "searchFirstName" );
>
> I tried to print out the firstName, I got a blank!
>
> Please advise what went wrong.

JSP tags are processed *on server*. For your setup to work you need to
submit a pag with <html-el:text property="searchFirstName" /> to the
server first, read value from request parameter and stick it into
appropriate scope under "searchFirstName" name.

Then, when you forward to JSP from your action, JSP/servlet engine
will process JSP tags, still *on server*. It will read
"searchFirstName" from servlet scope and write out its value into
generated HTML markup. Then resulting HTML page will be sent to
browser.

If you want to do the whole thing on client, use HTML form and submit
it with GET method. This way form fields will be appended to "action"
URL, exactly as you wanted.

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