Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
| Search | Today's Posts | Mark Forums Read
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 18th, 2012, 05:37 PM
Authorized User
Points: 101, Level: 2
Points: 101, Level: 2 Points: 101, Level: 2 Points: 101, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default passing portlet variable

This has got to be simple, I am just not doing it properly.

I have a JSR-268 portlet created.

Down in my source packages i have my portletname.java file

in that file i have String name = "bob";

I want to display that variable on my view.jsp page

please tell me how to properly pass it and display it.

Thanks much in advance.
 
Old January 18th, 2012, 05:59 PM
Authorized User
Points: 101, Level: 2
Points: 101, Level: 2 Points: 101, Level: 2 Points: 101, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

to answer my own question anyone's for that matter

it is simply passed by setting a RenderRequest attribute

request.setAttribute("variable", variablename);



then in the jsp

request.getAttribute("variablename");




Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing variable to a public variable Hudson40 Access VBA 2 February 25th, 2005 06:23 AM
Passing a variable trekmp ADO.NET 1 March 4th, 2004 01:57 PM
passing variable gumgak Classic ASP Databases 13 June 29th, 2003 09:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.