• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to add dynamic value in URL from faces-config

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

I have a situation where i have to add dynamic value (like username) in URL from faces-config.xml.
I am using sunRI. In my application i am redirecting page from one page to another through navigation-rule of facec-config.

Ex-
<navigation-rule>
<from-view-id>/EnrEmployer.jsp</from-view-id>
<navigation-case>
<from-outcome>enroll</from-outcome>
<to-view-id>/Enroll.jsp?jobCode=1233</value></to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
in above code snippet i am redirecting page from EnrEmployer to Enroll . When the Enroll.jap page comes in URL then the URL will be look like as
[Applicatio-context]/Enroll.jsp?jobCode=1233 here url parameter(i.e. jobCode) easly added becouse its a static. I want to add username in URL. I want URL like bellow
[Applicatio-context]/Enroll.jsp?jobCode=1233&username=abc /// supose here abc is username which is currently looged in the application

I have UserDTO which holds all the user ralated information. I also save this DTO into session.

How can i add username in url through facesd-config..

Your suugestion will highly appriciate

Thanks in advance
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's not normally how you do things in JSF. Just aside from everything else, JSF URLs don't track their related resources that accurately.

Plus, to tell the truth, outputting data to the client in a URL and then getting it back again adds a small but definite amount of extra network overhead for the extra data and (more importantly!) makes it easier to hack the app.

Instead, you should consider placing this information in a JSF backing bean that the target can then reference as a POJO property.

An additional caution is in order. Although you can mix vanilla JSPs and JSF, you cannot use JSF navigation rules to invoke a vanilla JSP from a JSF. Navigation rules can only reference JSF Views.
 
roby george
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thnks for you sugeestion Tim
i know it is not secure to add parameter in URL , BUT i want to add that . If suppose i haved added the property in my backing bean then how can i access that in faces-config.

Thanks in advance
 
roby george
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i m still waiting for anysuggestion.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic