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.
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..
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.
An IDE is no substitute for an Intelligent Developer.
Joined: Sep 08, 2010
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.