• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

JavaServer Faces - forwarding (like JSP:FORWARD) but ...

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

I would like to (auto)forward in the first page of my app (without user influence).
But I dont know how to activate an action with this "forward".

If I use <JSP:FORWARD ...> no action is being activated...

Has JSF something there? Or there is another way...

Thanks!
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do this for the weclome-file. I have an index.jsp that has the following code:



So when the user goes to http://whatever/appname the get automatically redirected to my welcome page which is a faces page. Is that what you were looking for?

A little reasoning: JSF and the welcome-file part of web.xml don't work together. MyFaces has a welcome file filter that is supposed to make it work, but I have been unable to get it to work correctly.
 
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Javoso Torso:
Hello!

I would like to (auto)forward in the first page of my app (without user influence).
But I dont know how to activate an action with this "forward".

If I use <JSP:FORWARD ...> no action is being activated...

Has JSF something there? Or there is another way...

Thanks!



I faced this problem too, couldn't look into it but did managed to find a work around.

I created a page, with a button (I hided the button with DHTML). Now "onload" of that page, I "clicked" the button "programmatically", hence the action method of button was called and in the action method, I used NavigationHandler.handleNavigation to direct the request to the page
I wanted.
Thuogh it worked perfectly, I know it's probably ugly
[ December 29, 2004: Message edited by: K Varun ]
 
Javoso Torso
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gregg: but you are not going through an action to that welcome page (or ...?).
That is the functionality I am looking for.

Varun: is funny, I was also thinking in such a solution. And beside the style problem (as you said, not looking very well), I though the user will see a flicker (because of the page being loaded and immediately submited). Is that happening to you?

Regards,
Javo
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Javoso Torso:

I though the user will see a flicker (because of the page being loaded and immediately submited). Is that happening to you?
Regards,
Javo



We use a "please wait" kind of image, whenever user submits any request.
I put that image in this page too, hence there wasn't any break.

But even if you use jsp:forward, that page will appear momentarily so instead of jsp:forward you can use this approach.

But again, it's dodgy. I have seen examples of jsp:include in sun specs. jsp:forward should also work.
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is there a better way with JSF1.2 ?
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic