<entry key="webaddsuccess" value="redirect:/web.do?method=friendSitelist"/>
posted @
2007-04-27 09:30 摩西 阅读(894) |
评论 (2) |
编辑 收藏
jsp页面代码:
<% boolean isClubManager=false;
Long regionid2 = ((Region)request.getSession().getAttribute("RegionSession")).getId();
isClubManager=newsPostService.isClubManager(regionid2);
Region region=(Region)request.getSession().getAttribute("RegionSession");
String memo=region.getParent().getMemo();
request.setAttribute("memo",memo);
%>
.........
<gd:label maxLength="150" text="${memo}"/>
posted @
2007-04-24 14:02 摩西 阅读(1857) |
评论 (0) |
编辑 收藏
ClientService.java
package com.soft.client;
import org.apache.axis.client.Service;
import javax.xml.rpc.ServiceException;
import java.net.MalformedURLException;
import org.apache.axis.client.Call;
import org.apache.axis.encoding.ser.BeanDeserializerFactory;
import javax.xml.namespace.QName;
import org.apache.axis.encoding.ser.BeanSerializerFactory;
import java.rmi.RemoteException;
public class ClientService {
public ClientService() {
}
public UserDTO getUserDTO() {
String endpoint = "http://localhost:8080/WebModule/services/Myservice";
QName qset = new QName("urn:Myservice", "UserDTO");
QName qmethod = new QName("urn:Myservice", "getUserDTO");
Class clsUserDTO = UserDTO.class;
UserDTO dto = new UserDTO();
Service service = new Service();
try {
Call call = (Call) service.createCall();
call.registerTypeMapping(clsUserDTO, qset,
new BeanSerializerFactory(clsUserDTO, qset),
new BeanDeserializerFactory(clsUserDTO,qset));
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName(qmethod);
call.setReturnClass(clsUserDTO);
dto = (UserDTO) call.invoke(new Object[] {});
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return dto;
}
public static void main(String[] args) {
ClientService cs = new ClientService();
UserDTO user = cs.getUserDTO();
System.out.println(user.getPassword());
System.out.println(user.getUsername());
}
}
UserDTO.java
package com.soft.client;
public class UserDTO {
private String username;
private String password;
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
posted @
2007-04-16 16:58 摩西 阅读(276) |
评论 (0) |
编辑 收藏
报错信息:
org.apache.jasper.JasperException: <h3>Validation error messages from TagLibraryValidator for c</h3><p>null: com.caucho.xml.XmlParseException: stream:276: expected character in cdata at `?' (\ufffd)</p><h3>Validation error messages from TagLibraryValidator for sql</h3><p>null: com.caucho.xml.XmlParseException: stream:276: expected character in cdata at `?' (\ufffd)</p><h3>Validation error messages from TagLibraryValidator for x</h3><p>null: com.caucho.xml.XmlParseException: stream:276: expected character in cdata at `?' (\ufffd)</p><h3>Validation error messages from TagLibraryValidator for fmt</h3><p>null: com.caucho.xml.XmlParseException: stream:276: expected character in cdata at `?' (\ufffd)</p>
posted @
2007-04-16 16:07 摩西 阅读(1500) |
评论 (1) |
编辑 收藏
<script language="javascript">document.write(week[${status.index}])</script>
posted @
2007-04-16 14:42 摩西 阅读(1171) |
评论 (2) |
编辑 收藏
.jsp加入代码:
<c:set scope="session" value="${page.result}" var="page"></c:set>
<c:set value="${page1.result}" var="page1" scope="session"></c:set>
<c:set value="${page2.result}" var="page2" scope="session"></c:set>
报错:
avax.servlet.jsp.el.ELException: The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value cannot be converted to an integer.
可见这种<c:set>的用法是错误的!!!!!!
posted @
2007-04-16 13:49 摩西 阅读(1317) |
评论 (0) |
编辑 收藏
import java.util.Map.Entry;
private static Map oldvote=new HashMap();
...............................
ModelAndView mav = new ModelAndView();
String voteid = ServletRequestUtils.getRequiredStringParameter(request,
"voteid");
String ip = ServletRequestUtils.getStringParameter(request, "ip");
//遍历HasMap
Boolean isoldvote=false;
Iterator it=oldvote.entrySet().iterator();
while(it.hasNext()){
Entry entry=(Entry) it.next();
Object key=entry.getKey();
Object value=entry.getValue();
if(key.equals(voteid)&&value.equals(ip)){
isoldvote=true;
break;
}
}
if (isoldvote) {
...............................
posted @
2007-04-14 09:41 摩西 阅读(362) |
评论 (0) |
编辑 收藏
<a href="javascript:history.go(-1);">[返回]</javascript>
posted @
2007-04-14 09:39 摩西 阅读(1750) |
评论 (1) |
编辑 收藏
1.
<html>
<head>
<title>transPara.htm</title>
</head>
<body>
<form method="POST" action="acceptPara.jsp">
<p align="center">
姓 名:<input type="text" name="name" size="20"><br>
年 龄: <input type="text" name="age" size="15"><br>
性 别:
<input type="radio" value="male" checked name="sex">
男
<input type="radio" name="sex" value="female">女</p>
<p align="center">
<input type="submit" value="submit" name="submit">
<input type="reset" value="reset" name="reset"></p>
</form>
</body>
</html>
2.
<html>
<%@ page contentType="text/html;charset=gb2312"%>
<jsp:useBean id="atest" class="test.AcceptPara"/>
<head><title>acceptPara.jsp</title></head>
<body>
<jsp:setProperty name="atest" property="*"/> // ***将javabean中的属性自动与html提交过来的变量匹配***********
Value of property "name" :
<jsp:getProperty name="atest" property="name"/><br>
Value of property "age" :
<jsp:getProperty name="atest" property="age"/><br>
Value of property "sex" :
<jsp:getProperty name="atest" property="sex"/><br>
Value of property "submit" :
<jsp:getProperty name="atest" property="submit"/><br>
</body>
</html>
3.
package test;// 在一些tomcat旧版本包定义一定要有,且在jsp引用中如下:<jsp:useBean id="atest" class="test.AcceptPara"/> 编译后放在\WEB-INF\classes\test\中
public class AcceptPara{
String name;
int age;
String sex;
String submit;
public void setName(String value){
name=value;
}
public String getName(){
return name;
}
public void setAge(int value){
age=value;
}
public int getAge(){
return age;
}
public void setSex(String value){
sex=value;
}
public String getSex(){
return sex;
}
public void setSubmit(String value){
submit=value;
}
public String getSubmit(){
return submit;
}
public void acceptPara(){}
}
posted @
2006-09-08 12:41 摩西 阅读(762) |
评论 (2) |
编辑 收藏
1.Forward_demo.htm:
<html>
<head><title>Forward_demo1.htm</title></head>
<body>
<form action="demo1.jsp" method="POST">用户:<input type="text" name="username" size="20"><br>
密码:<input type="password" name="password" size="20"><br>
<input type="radio" name="select" value="manage" checked>管理<br>
<input type="radio" name="select" value="statictic">资料<br>
<input type="submit" name="login" value="submit">
<input type="reset" name="reset" value="重写">
</form>
</body>
</html>
2.demo1.jsp:<html>
<head><title>demo1.jsp</title></head>
<body>
<%
String username,password,choice;
username=request.getParameter("username");
password=request.getParameter("password");
choice=request.getParameter("select");
if (choice.equals("manage")){
%>
<jsp:forward page="demo1.1.jsp">
<jsp:param name="username" value="<%=username%>"/>
<jsp:param name="password" value="<%=password%>"/>
</jsp:forward>
<% }else{
//user select statistic
%>
<jsp:forward page="demo1.2.jsp">
<jsp:param name="username" value="<%=username%>"/>
<jsp:param name="password" value="<%=password%>"/>
</jsp:forward>
<%
}
%>
</body>
</html>
3.demo1.1.jsp:<html>
<head>
<title>demo1.1.jsp</title>
</head>
<body>
This is the Management Page!<br>
<%
String user,pwd;
user=request.getParameter("username");
pwd=request.getParameter("password");
%>
username is: <%=user%><br>
password is: <%=pwd%><br>
</body>
</html>
4.demo1.2.jsp:<html>
<head>
<title>demo1.2.jsp</title>
</head>
<body>
This is the Statistic Page!<br>
<%
String user,pwd;
user=request.getParameter("username");
pwd=request.getParameter("password");%>
username is: <%=user%><br>
password is: <%=pwd%><br>
</body>
</html>
posted @
2006-09-07 14:21 摩西 阅读(4855) |
评论 (2) |
编辑 收藏