This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I am using the following code to retrieve data in a HTTP request <% Enumeration names;
names = request.getParameterNames(); if ((names != null) && (names.hasMoreElements())) { while (names.hasMoreElements()) { String name = (String) names.nextElement(); //get the value of the next element, cast it to a string
if(name.equals("orgConsTitle")){ String values[] = request.getParameterValues(name); for (int i = 0; i < values.length; i++){String title = XMLencode(values[i]);} } How do I retreive the value of the String title to display in the page? Thanks
Brian Glodde
Ranch Hand
Joined: Jun 27, 2001
Posts: 171
posted
0
I didn't test this but you'll definitely need to move your declaration of "title" from the scope of the loop:
Hope that helps!
Tim Wild
Greenhorn
Joined: Jun 10, 2002
Posts: 3
posted
0
Thanks but I'm still getting errors Is the following sufficient to instantiate the variable, does it not need a default value?
Is it possible to assign a value to the variable from within a method. I've read about instance variables etc but confess to not fully understanding it.
Thanks
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
posted
0
if it is declared within a method, it will need to be given an initial value. The compiler will not even allow it.
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.