• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Flow being lost

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have set up three .jsp pages (input.jsp and output.jsp and error.jsp).

On the input.jsp I have a listbox � single select. When the submit button is clicked, based on the value chosen, input.jsp is directed to the correct page. In the submit button action handler, I have placed the following code:

Note: I changed the actual names of the classes and methods.

public String doButton1Action() {
SomeClass ilClass = new SomeClass();
java.lang.String ilString = getListbox1().getValue().toString(); //value of the listbox

if(ilString.equals("000"))
return "input"; //navigates to the correct page
else if(ilString.equals("111"))
{
if(ilString.equals(String.valueOf(ilClass.getAnAttribute())))
{
java.lang.String ilValue = ilClass.AssembleAReallyLongString();
requestScope.put("P", ilValue); //I�ve even tried to hard code a literal but that doesn�t work either
}
return "success"; //navigates to the correct page
}
else
return "fail"; //navigates to the correct page

}

In output.jsp, I�ve declared a requestScope scripting variable called P of type java.lang.String and bound it to an output control. The output.jsp output control�s format is String.

In input.jsp, I tried both ways by declaring and not declare a requestScope scripting variable called P.

With either case, the String will not display in the output.jsp control that I bound the requestScope scripting P to.

Am I going about this wrong? Would you have any suggestions?

Any help is appreciated.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is requestScope and where does it come from?

Anyway, it looks like a weird way to pass values from one to other page. What exactly do you want to achieve? Is the managed bean request or session scoped? Can you show some snippets of the relevant JSF code?
 
Sheriff
Posts: 67693
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Metariya",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic