File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes JSF how to get link parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF how to get link parameter " Watch "JSF how to get link parameter " New topic
Author

JSF how to get link parameter

Hoe Chin
Greenhorn

Joined: Jul 01, 2009
Posts: 23
i got a page that once the user enter the details click on submit button a reset password link will send to user email account i add a resetId in the link like this
http//localhost:8080/Test/Reset.faces?id=asedfr1241243a123sfsdf

Once the user click on the link how can i get the parameter values immediately the user click on the link? Because i want to check the reset Id is still valid or not if is expire den will redirct user to another page or show that this page is no longer exist how can i do that?
viswanath yadav
Greenhorn

Joined: May 25, 2009
Posts: 15

This code may helpful for you, go through this code, you have to write the code in Action class in struts to get the Id of the link what you pressed.

Follow the code below,

public class QueryAction extends Action
{

private static final String ID_LINK = "IdofyourLink"; ------>(Id of the link)
private static Logger logger = Logger.getLogger(ContentQueryAction.class);

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
{

DynaActionForm dynaForm = (DynaActionForm)form;
String linkId = (String) dynaForm.get(ID_LINK); ---> get the Id of the link and then validate it is correct or not.

..................
..................
}
}



Thank's

Viswanath Angajala
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSF how to get link parameter
 
Similar Threads
Click tracking in Java
How to pass a Post parameter using a link?
how to capture form varibales in JSP and form a html link?
Java access parameter pass by URL
JSP + useBeans + flush all my contents in my page