You can access the parameter from QueryString in Portlet. Consider QueryString is like this
http://localhost:60035/wps/portal/checkout?PhoneId=35102
Portlet Code as below :
public class TestPortlet com.ibm.faces.portlet.FacesPortlet {
public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
String phoneId = getparamter("PhoneId" request);
super.doView(request, response);
}
private String getparamter(String key,RenderRequest request){
String value = null ;
try{
if(request instanceof org.apache.pluto.core.impl.RenderRequestImpl ){
RenderRequestImpl renderRequestImpl = (RenderRequestImpl)request;
if(renderRequestImpl!=null){
String QueryString = renderRequestImpl.getQueryString();
if(QueryString!=null && QueryString.length() > 0){
StringTokenizer tokenizer = new StringTokenizer(renderRequestImpl.getQueryString(),"&");
while (tokenizer.hasMoreElements()) {
String token = (String) tokenizer.nextElement();
if(token.indexOf(key)!=-1){
value = token.substring(token.indexOf("=")+1);
break;
}
}
System.out.println("key value in getparamter :"+value);
}
}
}
}catch(Exception e){
System.out.println("error occured while accessing QueryString "+e.getMessage());
}
return value;
}
Subscribe to:
Post Comments (Atom)
Followers
Blog Archive
-
▼
2009
(13)
-
▼
October
(9)
- Accessing parameter from QueryString in IBM WebSph...
- Accessing parameter from QueryString in IBM WebSph...
- Accessing parameter from QueryString in IBM WebSph...
- IBM Websphere Application Server to initialize a s...
- How to use Httpsession for user data sharing in I...
- Access the url parameter from IBM WebSphere Portal...
- Enable Remember Me Cookie in IBM WebSphere Portal ...
- Configuring a stand‐alone LDAP user registry on Wi...
- How to get path(/wps/portal or /wps/myportal) in I...
-
▼
October
(9)
No comments:
Post a Comment