Here I have simple Portlet Code.
public void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException {
String phoneId = getparamter("PhoneId" request);
}
private String getparamter(String key, RenderRequest request) {
String value = null;
try {
RunData rd = RunData.from((ServletRequest) request);
String strURL = rd.getRequestURL();
log.info("Request URL is " + strURL);
String strSplit = strURL.substring(strURL.indexOf('?') + 1);
log.info("Parameter URL is" + strSplit);
StringTokenizer tokenizer = new StringTokenizer(strSplit);
while (tokenizer.hasMoreElements()) {
String token = (String) tokenizer.nextElement();
if (token.indexOf(key) != -1) {
value = token.substring(token.indexOf("=") + 1);
break;
}
}
log.info("key value in getparamter :" + value);
if (value.indexOf("&") > 0) {
value = value.substring(0, value.indexOf("&"));
log.info("Parameter URL is" + value);
}
} catch (Exception e) {
log.error("No value retrieved from URL");
e.printStackTrace();
}
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