import java.util.*;
import lotus.domino.*;
/*该类主要是取得从前台页面get或post过来的数据*/
public class URLRequest {
private Session session;
private String postContent;
private String urlContent;
public URLRequest(Session session){
try{
//取得Session并赋值
if(session != null){
this.session = session;
//取得Post过来的数据并解码
Vector vPost = this.session.evaluate("@UrlDecode('Domino';'" + this.session.getAgentContext().getDocumentContext().getItemValueString("Request_Content") + "')");
postContent = "&" + vPost.firstElement().toString().toUpperCase() + "&";
vPost = null;
//取得Get过来的数据并解码
Vector vUrl = this.session.evaluate("@UrlDecode('Domino';'" + this.session.getAgentContext().getDocumentContext().getItemValueString("Query_String") + "')");
urlContent = "&" + vUrl.firstElement().toString().toUpperCase() + "&";
vUrl = null;
}
}catch(Exception e){
//处理异常代码
System.out.println(e.getMessage());
}
}
//取得Post的参数值
public String getPostQueryString(String parameterName){
int i;
int startpos;
int endpos;
try{
if(!postContent.equals("")){
parameterName = "&" + parameterName.toUpperCase() + "=";
i = postContent.indexOf(parameterName);
if(i > -1){
startpos = parameterName.length() + i;
endpos = postContent.indexOf("&",startpos);
return postContent.substring(startpos, endpos);
}else{
return "";
}
}else{
return "";
}
}catch(Exception e){
e.getMessage();
return "";
}
}
//取得Get的参数值
public String getUrlQueryString(String parameterName){
int i;
int startpos;
int endpos;
try{
if(!urlContent.equals("")){
parameterName = "&" + parameterName.toUpperCase() + "=";
i = urlContent.indexOf(parameterName);
if(i > -1){
startpos = parameterName.length() + i;
endpos = urlContent.indexOf("&",startpos);
return urlContent.substring(startpos, endpos);
}else{
return "";
}
}else{
return "";
}
}catch(Exception e){
e.getMessage();
return "";
}
}
}
import lotus.domino.*;
/*该类主要是取得从前台页面get或post过来的数据*/
public class URLRequest {
private Session session;
private String postContent;
private String urlContent;
public URLRequest(Session session){
try{
//取得Session并赋值
if(session != null){
this.session = session;
//取得Post过来的数据并解码
Vector vPost = this.session.evaluate("@UrlDecode('Domino';'" + this.session.getAgentContext().getDocumentContext().getItemValueString("Request_Content") + "')");
postContent = "&" + vPost.firstElement().toString().toUpperCase() + "&";
vPost = null;
//取得Get过来的数据并解码
Vector vUrl = this.session.evaluate("@UrlDecode('Domino';'" + this.session.getAgentContext().getDocumentContext().getItemValueString("Query_String") + "')");
urlContent = "&" + vUrl.firstElement().toString().toUpperCase() + "&";
vUrl = null;
}
}catch(Exception e){
//处理异常代码
System.out.println(e.getMessage());
}
}
//取得Post的参数值
public String getPostQueryString(String parameterName){
int i;
int startpos;
int endpos;
try{
if(!postContent.equals("")){
parameterName = "&" + parameterName.toUpperCase() + "=";
i = postContent.indexOf(parameterName);
if(i > -1){
startpos = parameterName.length() + i;
endpos = postContent.indexOf("&",startpos);
return postContent.substring(startpos, endpos);
}else{
return "";
}
}else{
return "";
}
}catch(Exception e){
e.getMessage();
return "";
}
}
//取得Get的参数值
public String getUrlQueryString(String parameterName){
int i;
int startpos;
int endpos;
try{
if(!urlContent.equals("")){
parameterName = "&" + parameterName.toUpperCase() + "=";
i = urlContent.indexOf(parameterName);
if(i > -1){
startpos = parameterName.length() + i;
endpos = urlContent.indexOf("&",startpos);
return urlContent.substring(startpos, endpos);
}else{
return "";
}
}else{
return "";
}
}catch(Exception e){
e.getMessage();
return "";
}
}
}