You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vinod Kumar <vk...@yahoo.com> on 2006/09/27 00:21:56 UTC

cannot get value using request.getParameter in struts tiles layout file

I am not able to get the value of the request
parameter using request.getParameter("Print")
I am trying to get this value in the layout-tiles.jsp
file.
I use this URL to make the call
http://localhost/appname/jsp/login.jsp?print=1

below are the two files. Any help will be appreciated.


***********start of layout-tiles.jsp**************

<%

String  printParm1 = request.getParameter( "print" );

System.out.println("printParm1 = "+printParm1);
%>

%>

<html:html>
<head>

	<title><tiles:insert attribute="title"/></title>

	<%@ include file="include/printable.jsp" %>

	<tiles:insert attribute="head"/>

	
</head>

<body>


<tiles:insert attribute="top"/>


<tiles:insert attribute="content"/>

<tiles:insert attribute="bottom"/>

</body>
</html:html>
**********end of layout-tiles.jsp****************

**********start of login.jsp*********************
<tiles:insert page="layout-tiles.jsp" flush="true">
	<tiles:put name="head" value="head.jsp"/>
	<tiles:put name="top" value="top.jsp"/>
	<tiles:put name="bottom" value="bottom.jsp" />
	<tiles:put name="title"
value="htmlHeader.jsp?htmlHeader=login.title&pageTitle=login.page.title&thisPage=login.jsp"
/>
    <tiles:put name="content" value="login-body.jsp"/>
</tiles:insert>
*********end of login.jsp************************

__________________________________________________
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: cannot get value using request.getParameter in struts tiles layout file

Posted by Vinod Kumar <vk...@yahoo.com>.
Actually, value of "print" variable is not fixed. It
can be 0 (not printable) or 1 (printable version). So
unless, I could get this value from
request.getParameter, I can't even make it hidden.

Thanks
Vinod

--- Uday Chandra Karrothi <ud...@gmail.com>
wrote:

> Can you use the formBean?
> Something like pgForm.getPrint(); // i am not sure
> though
> 
> or
> you can try this.
> Declare Print as a hidden variable in the jsp page.
> That way i think
> you will be able to access the variable.
> 
> <html:hidden property="Print" />
> try this. I hope that works.
> 
> Uday
> 
> On 9/26/06, Vinod Kumar <vk...@yahoo.com> wrote:
> > I am not able to get the value of the request
> > parameter using request.getParameter("Print")
> > I am trying to get this value in the
> layout-tiles.jsp
> > file.
> > I use this URL to make the call
> > http://localhost/appname/jsp/login.jsp?print=1
> >
> > below are the two files. Any help will be
> appreciated.
> >
> >
> > ***********start of layout-tiles.jsp**************
> >
> > <%
> >
> > String  printParm1 = request.getParameter( "print"
> );
> >
> > System.out.println("printParm1 = "+printParm1);
> > %>
> >
> > %>
> >
> > <html:html>
> > <head>
> >
> >         <title><tiles:insert
> attribute="title"/></title>
> >
> >         <%@ include file="include/printable.jsp"
> %>
> >
> >         <tiles:insert attribute="head"/>
> >
> >
> > </head>
> >
> > <body>
> >
> >
> > <tiles:insert attribute="top"/>
> >
> >
> > <tiles:insert attribute="content"/>
> >
> > <tiles:insert attribute="bottom"/>
> >
> > </body>
> > </html:html>
> > **********end of layout-tiles.jsp****************
> >
> > **********start of login.jsp*********************
> > <tiles:insert page="layout-tiles.jsp"
> flush="true">
> >         <tiles:put name="head" value="head.jsp"/>
> >         <tiles:put name="top" value="top.jsp"/>
> >         <tiles:put name="bottom"
> value="bottom.jsp" />
> >         <tiles:put name="title"
> >
>
value="htmlHeader.jsp?htmlHeader=login.title&pageTitle=login.page.title&thisPage=login.jsp"
> > />
> >     <tiles:put name="content"
> value="login-body.jsp"/>
> > </tiles:insert>
> > *********end of login.jsp************************
> >
> > __________________________________________________
> > 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
> >
> >
> 
> 
> -- 
> Never explain--your friends do not need it and your
> enemies will not
> believe you anyway--Elbert Hubbard
> 
>
---------------------------------------------------------------------
> 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: cannot get value using request.getParameter in struts tiles layout file

Posted by Uday Chandra Karrothi <ud...@gmail.com>.
Can you use the formBean?
Something like pgForm.getPrint(); // i am not sure though

or
you can try this.
Declare Print as a hidden variable in the jsp page. That way i think
you will be able to access the variable.

<html:hidden property="Print" />
try this. I hope that works.

Uday

On 9/26/06, Vinod Kumar <vk...@yahoo.com> wrote:
> I am not able to get the value of the request
> parameter using request.getParameter("Print")
> I am trying to get this value in the layout-tiles.jsp
> file.
> I use this URL to make the call
> http://localhost/appname/jsp/login.jsp?print=1
>
> below are the two files. Any help will be appreciated.
>
>
> ***********start of layout-tiles.jsp**************
>
> <%
>
> String  printParm1 = request.getParameter( "print" );
>
> System.out.println("printParm1 = "+printParm1);
> %>
>
> %>
>
> <html:html>
> <head>
>
>         <title><tiles:insert attribute="title"/></title>
>
>         <%@ include file="include/printable.jsp" %>
>
>         <tiles:insert attribute="head"/>
>
>
> </head>
>
> <body>
>
>
> <tiles:insert attribute="top"/>
>
>
> <tiles:insert attribute="content"/>
>
> <tiles:insert attribute="bottom"/>
>
> </body>
> </html:html>
> **********end of layout-tiles.jsp****************
>
> **********start of login.jsp*********************
> <tiles:insert page="layout-tiles.jsp" flush="true">
>         <tiles:put name="head" value="head.jsp"/>
>         <tiles:put name="top" value="top.jsp"/>
>         <tiles:put name="bottom" value="bottom.jsp" />
>         <tiles:put name="title"
> value="htmlHeader.jsp?htmlHeader=login.title&pageTitle=login.page.title&thisPage=login.jsp"
> />
>     <tiles:put name="content" value="login-body.jsp"/>
> </tiles:insert>
> *********end of login.jsp************************
>
> __________________________________________________
> 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
>
>


-- 
Never explain--your friends do not need it and your enemies will not
believe you anyway--Elbert Hubbard

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


Re: cannot get value using request.getParameter in struts tiles layout file

Posted by Uday Chandra Karrothi <ud...@gmail.com>.
HI vinod,
its not the value of print that you need to make hidden. The variable
name Print or whatever value you are passing. Try having that varaible
as a hiddden property in the form. I hope that helps. I solved one of
the problems liek that. But this may not work for you.

Thanks
Uday

On 9/27/06, Vinod Kumar <vk...@yahoo.com> wrote:
> Yes, but its showing null. basically,
> request.getParameter("print") is returning Null even
> when I pass a value of 1.
>
> thanks
> Vinod
>
> --- Antonio Petrelli <ap...@apache.org> wrote:
>
> > Vinod Kumar ha scritto:
> > > <%
> > >
> > > String  printParm1 = request.getParameter( "print"
> > );
> > >
> > > System.out.println("printParm1 = "+printParm1);
> > > %>
> > >
> >
> > This may be a stupid question but.... You suppose to
> > see the "print"
> > parameter value in the console, right?
> >
> > Ciao
> > Antonio
> >
> >
> ---------------------------------------------------------------------
> > 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
>
>


-- 
Never explain--your friends do not need it and your enemies will not
believe you anyway--Elbert Hubbard

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


Re: cannot get value using request.getParameter in struts tiles layout file

Posted by Vinod Kumar <vk...@yahoo.com>.
Yes, but its showing null. basically,
request.getParameter("print") is returning Null even
when I pass a value of 1.

thanks
Vinod

--- Antonio Petrelli <ap...@apache.org> wrote:

> Vinod Kumar ha scritto:
> > <%
> >
> > String  printParm1 = request.getParameter( "print"
> );
> >
> > System.out.println("printParm1 = "+printParm1);
> > %>
> >   
> 
> This may be a stupid question but.... You suppose to
> see the "print" 
> parameter value in the console, right?
> 
> Ciao
> Antonio
> 
>
---------------------------------------------------------------------
> 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: cannot get value using request.getParameter in struts tiles layout file

Posted by Antonio Petrelli <ap...@apache.org>.
Vinod Kumar ha scritto:
> <%
>
> String  printParm1 = request.getParameter( "print" );
>
> System.out.println("printParm1 = "+printParm1);
> %>
>   

This may be a stupid question but.... You suppose to see the "print" 
parameter value in the console, right?

Ciao
Antonio

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