You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Madhan <ma...@tcs.com> on 2010/07/14 14:58:05 UTC
How to pass context-param values to different WebPages ?
I am new to wicket.
I have created a simple web-app which displays my name in a label.
However, when I wanted to extend the web app by fetching my name from
web.xml, though I was able to get the context parameters in the init method
of the application class, I am not sure how to send the value to the
webpage.
Kindly let me know how to pass the context parameter from the application
class to the webpage class.
My development environment for Wicket 1.4.9 is as follows,
OS : Windows XP SP3
App Server : apache-tomcat-6.0.26
JDK : 1.6.0_17
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-pass-context-param-values-to-different-WebPages-tp2288699p2288699.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: How to pass context-param values to different WebPages ?
Posted by Stefan Lindner <li...@visionet.de>.
Your are new to Java too?
Did you override the get() method in your IndexApplication? If not, IndexApplication.get results in an Applicationobject and not in an IndexApplication object. Either cast it in your opage oder create your own get methodn in IndexApplication.
add( new Label( "userName", ((IndexApplication)(IndexApplication.get())).getUserName() ) );
-----Ursprüngliche Nachricht-----
Von: Madhan [mailto:madhan.sundararajan@tcs.com]
Gesendet: Mittwoch, 14. Juli 2010 15:29
An: users@wicket.apache.org
Betreff: RE: How to pass context-param values to different WebPages ?
I tried the following statement in the constructor of my WebPage class,
add( new Label( "userName", (IndexApplication.get()).getUserName() ) );
I got the following error,
IndexPage.java:10: cannot find symbol
symbol : method getUserName()
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-pass-context-param-values-to-different-WebPages-tp2288699p2288744.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: How to pass context-param values to different WebPages ?
Posted by Madhan <ma...@tcs.com>.
I tried the following statement in the constructor of my WebPage class,
add( new Label( "userName", (IndexApplication.get()).getUserName() ) );
I got the following error,
IndexPage.java:10: cannot find symbol
symbol : method getUserName()
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-pass-context-param-values-to-different-WebPages-tp2288699p2288744.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: How to pass context-param values to different WebPages ?
Posted by Stefan Lindner <li...@visionet.de>.
Create a getMyName-method in Applicatoin class and call
Application.get().getMyName() in your page class
Stefan
-----Ursprüngliche Nachricht-----
Von: Madhan [mailto:madhan.sundararajan@tcs.com]
Gesendet: Mittwoch, 14. Juli 2010 14:58
An: users@wicket.apache.org
Betreff: How to pass context-param values to different WebPages ?
I am new to wicket.
I have created a simple web-app which displays my name in a label.
However, when I wanted to extend the web app by fetching my name from
web.xml, though I was able to get the context parameters in the init method
of the application class, I am not sure how to send the value to the
webpage.
Kindly let me know how to pass the context parameter from the application
class to the webpage class.
My development environment for Wicket 1.4.9 is as follows,
OS : Windows XP SP3
App Server : apache-tomcat-6.0.26
JDK : 1.6.0_17
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-pass-context-param-values-to-different-WebPages-tp2288699p2288699.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How to pass context-param values to different WebPages ?
Posted by Bilgin Ibryam <bi...@gmail.com>.
((YourApplication)getApplication()).getServletContext().getAttribute(attrName);
Bilgin
On Wed, Jul 14, 2010 at 1:58 PM, Madhan <ma...@tcs.com> wrote:
>
> I am new to wicket.
>
> I have created a simple web-app which displays my name in a label.
>
> However, when I wanted to extend the web app by fetching my name from
> web.xml, though I was able to get the context parameters in the init method
> of the application class, I am not sure how to send the value to the
> webpage.
>
> Kindly let me know how to pass the context parameter from the application
> class to the webpage class.
>
> My development environment for Wicket 1.4.9 is as follows,
>
> OS : Windows XP SP3
> App Server : apache-tomcat-6.0.26
> JDK : 1.6.0_17
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-pass-context-param-values-to-different-WebPages-tp2288699p2288699.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>