/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.struts.action;
import java.util.*;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import com.ORM.*;
import com.base.*;
import com.service.*;
/**
* MyEclipse Struts
* Creation date: 09-15-2007
*
* XDoclet definition:
* @struts.action parameter="method" validate="true"
* @struts.action-forward name="browseWord" path="/Admin/adminWord.jsp"
* @struts.action-forward name="browseMember" path="/Admin/adminMember.jsp"
* @struts.action-forward name="viewWord" path="/Admin/WordInfo.jsp"
* @struts.action-forward name="viewMember" path="/Admin/MemberInfo.jsp"
*/
public class AdminMemberAction extends BaseAction {
/*
* Generated Methods
*/
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward browseMember(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
Admin admin = (Admin)request.getSession().getAttribute("Admin");
if (admin==null||admin.getAdminType().intValue()!=3){
return mapping.findForward("sorry");
}
MemService service = new MemServiceImpl();
List result = null;
try{
result = service.browseMember();
if(result!=null&&result.size()>0)request.setAttribute("memberList", result);
}catch(Exception ex){
logger.info("在执行AdminMemberAction类中的browseMember方法时出错:\n");
ex.printStackTrace();
}
return mapping.findForward("browseMember");
}
public ActionForward viewMember(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
MemService service = new MemServiceImpl();
Member member = null;
String p = request.getParameter("id");
Integer id = null;
if(p!=null){
id = new Integer(p);
}else{
id = new Integer(0);
}
try{
member = service.loadMember(id);
if(member!=null)request.setAttribute("member", member);
}catch(Exception ex){
logger.info("在执行AdminMemberAction类中的viewMember方法时出错:\n");
ex.printStackTrace();
}
return mapping.findForward("viewMember");
}
public ActionForward delMember(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
MemService service = new MemServiceImpl();
ActionMessages msgs = new ActionMessages();
String p = request.getParameter("id");
Integer id = null;
if(p!=null){
id = new Integer(p);
}else{
id = new Integer(0);
}
try{
boolean status = false;
status = service.delMember(id);
if (status){
msgs.add("delMemberStatus",new ActionMessage(Constants.MEMBER_DEL_SUC_KEY));
}else{
msgs.add("delMemberStatus",new ActionMessage(Constants.MEMBER_DEL_FAIL_KEY));
}
saveErrors(request, msgs);
}catch(Exception ex){
logger.info("在执行AdminMemberAction类中的delMember方法时出错:\n");
ex.printStackTrace();
}
return new ActionForward("/Admin/adminMember.do?method=browseMember");
}
public ActionForward browseWord(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
Admin admin = (Admin)request.getSession().getAttribute("Admin");
if (admin==null||admin.getAdminType().intValue()!=3){
return mapping.findForward("sorry");
}
WordService service = new WordServiceImpl();
List result = null;
try{
result = service.browseWord();
if(result!=null&&result.size()>0)request.setAttribute("wordList", result);
}catch(Exception ex){
logger.info("在执行AdminMemberAction类中的browseWord方法时出错:\n");
ex.printStackTrace();
}
return mapping.findForward("browseWord");
}
public ActionForward viewWord(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
WordService service = new WordServiceImpl();
Leaveword word = null;
String p = request.getParameter("id");
Integer id = null;
if(p!=null){
id = new Integer(p);
}else{
id = new Integer(0);
}
try{
word = service.loadWord(id);
if(word!=null)request.setAttribute("word", word);
}catch(Exception ex){
logger.info("在执行AdminMemberAction类中的viewWord方法时出错:\n");
ex.printStackTrace();
}
return mapping.findForward("viewWord");
}
public ActionForward answerWord(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
WordService service = new WordServiceImpl();
ActionMessages msgs = new ActionMessages();
String answerContent = request.getParameter("answerContent");
Admin admin = (Admin)request.getSession().getAttribute("Admin");
Leaveword word = null;
String p = request.getParameter("id");
Integer id = null;
if(p!=null){
id = new Integer(p);
}else{
id = new Integer(0);
}
try{
word = service.loadWord(id);
word.setAdmin(admin);
word.setAnswerContent(answerContent);
word.setAnswerDate(new Date());
boolean status = service.updateWord(word);
if (status){
msgs.add("answerWordStatus",new ActionMessage(Constants.WORD_ANSWER_SUC_KEY));
}else{
msgs.add("answerWordStatus",new ActionMessage(Constants.WORD_ANSWER_FAIL_KEY));
}
saveErrors(request, msgs);
}catch(Exception ex){
logger.info("在执行AdminMemberAction类中的answerWord方法时出错:\n");
ex.printStackTrace();
}
return new ActionForward("/Admin/adminMember.do?method=browseWord");
}
public ActionForward delWord(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
WordService service = new WordServiceImpl();
ActionMessages msgs = new ActionMessages();
String p = request.getParameter("id");
Integer id = null;
if(p!=null){
id = new Integer(p);
}else{
id = new Integer(0);
}
try{
boolean status = false;
status = service.delWord(id);
if (status){
msgs.add("delWordStatus",new ActionMessage(Constants.WORD_DEL_SUC_KEY));
}else{
msgs.add("delWordStatus",new ActionMessage(Constants.WORD_DEL_FAIL_KEY));
}
saveErrors(request, msgs);
}catch(Exception ex){
logger.info("在执行AdminMemberAction类中的delWord方法时出错:\n");
ex.printStackTrace();
}
return new ActionForward("/Admin/adminMember.do?method=browseWord");
}
}
-----------------------------------------分界线-------------------------------
在tomcat的lib中加入commons-long.jar抛出另一个错
HTTP Status 500 – Internal Server Error
Type Exception Report
Message javax.servlet.ServletException: java.lang.ExceptionInInitializerError
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.ExceptionInInitializerError
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:639)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:500)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
com.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:32)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Root Cause
javax.servlet.ServletException: java.lang.ExceptionInInitializerError
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:667)
org.apache.jsp.Admin.adminUser_jsp._jspService(adminUser_jsp.java:309)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
com.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:32)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Root Cause
java.lang.ExceptionInInitializerError
org.apache.commons.lang.builder.ToStringStyle$MultiLineToStringStyle.<init>(ToStringStyle.java:2119)
org.apache.commons.lang.builder.ToStringStyle$MultiLineToStringStyle.<init>(ToStringStyle.java:2116)
org.apache.commons.lang.builder.ToStringStyle.<clinit>(ToStringStyle.java:78)
org.apache.commons.lang.builder.ToStringBuilder.<clinit>(ToStringBuilder.java:97)
org.apache.commons.lang.ArrayUtils.toString(ArrayUtils.java:171)
org.apache.commons.lang.ArrayUtils.toString(ArrayUtils.java:152)
org.displaytag.export.ExportViewFactory.<init>(ExportViewFactory.java:61)
org.displaytag.export.ExportViewFactory.getInstance(ExportViewFactory.java:79)
org.displaytag.tags.TableTag.doStartTag(TableTag.java:709)
org.apache.jsp.Admin.adminUser_jsp._jspService(adminUser_jsp.java:232)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
com.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:32)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Root Cause
java.lang.NumberFormatException: multiple points
java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1914)
java.base/jdk.internal.math.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
java.base/java.lang.Float.parseFloat(Float.java:455)
org.apache.commons.lang.SystemUtils.getJavaVersionAsFloat(SystemUtils.java:1117)
org.apache.commons.lang.SystemUtils.<clinit>(SystemUtils.java:817)
org.apache.commons.lang.builder.ToStringStyle$MultiLineToStringStyle.<init>(ToStringStyle.java:2119)
org.apache.commons.lang.builder.ToStringStyle$MultiLineToStringStyle.<init>(ToStringStyle.java:2116)
org.apache.commons.lang.builder.ToStringStyle.<clinit>(ToStringStyle.java:78)
org.apache.commons.lang.builder.ToStringBuilder.<clinit>(ToStringBuilder.java:97)
org.apache.commons.lang.ArrayUtils.toString(ArrayUtils.java:171)
org.apache.commons.lang.ArrayUtils.toString(ArrayUtils.java:152)
org.displaytag.export.ExportViewFactory.<init>(ExportViewFactory.java:61)
org.displaytag.export.ExportViewFactory.getInstance(ExportViewFactory.java:79)
org.displaytag.tags.TableTag.doStartTag(TableTag.java:709)
org.apache.jsp.Admin.adminUser_jsp._jspService(adminUser_jsp.java:232)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
com.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:32)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Note The full stack trace of the root cause is available in the server logs.
Apache Tomcat/9.0.13