File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to add dynamic value in URL from faces-config

 
roby george
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17646
39
Android Eclipse IDE Linux
  • 1
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i m still waiting for anysuggestion.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic