毕业设计!急!SSH的新闻发布系统 tomcat没关闭吧 -检查控制台报错与否 ,捋顺逻辑再看 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 代码好长啊 我想发上来 做 附件,发不上啊 要不 大伙把email留下 我发过去 帮我看看 这是 NewsListTypeAction中的方法:public ActionForward insertNews(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { News news=null; String newsid = request.getParameter("newsid"); DynaValidatorForm f = (DynaValidatorForm) form; if(newsid!=null){ if(LoginAction.validator(request)==false){ return mapping.findForward("news.admin.login"); } news=manager.getNews(Integer.parseInt(newsid)); } else{ news=new News(); } news.setFrom((String)f.getString("from")); news.setContent((String)f.getString("content")); news.setFilename((String)f.getString("fileName")); news.setNewsid(Integer.parseInt((String)f.getString("newsid"))); news.setSubject((String)f.getString("subject")); String time=TimeUtil.getFormatTime("yyy-mm-dd hh:MM:ss"); news.setTime(time); news.setTypeid(Integer.parseInt((String)f.getString("typeid"))); manager.save(news); return admin(mapping, form, request, response);}接下来是jsp: <html:form action="/newsListType" > <html:hidden property="method" value="insertNews"/> <tr> <td colspan="2" style="padding:5px;"><html:errors/></td> </tr> <tr> <td width="113" height="25" align="right">新闻标题:</td> <td width="665" height="25"><html:text property="subject" styleClass="input1"/></td> </tr> <tr> <td height="25" align="right">文件:</td> <td height="25"><html:text property="filename" styleClass="input1"/></td> </tr> <tr> <td height="25" align="right">发布人:</td> <td height="25"><html:text property="from" styleClass="input1"/></td> </tr> <tr> <td height="25" align="right">新闻内容:</td> <td height="25"> <html:textarea property="content" cols="80" rows="10"/> </td> </tr> <tr> <td height="25" align="right">发布日期:</td> <td height="25"><html:text property="time" styleClass="input1"/></td> </tr> <tr> <td height="25" align="right">新闻类别:</td> <td height="25"><html:select property="typeid" styleClass="input1" > <html:option value="1">焦点</html:option> <html:option value="2">国内</html:option> <html:option value="3">国际</html:option> <html:option value="4">娱乐</html:option> <html:option value="5">体育</html:option> <html:option value="6">游戏</html:option> <html:option value="7">更多</html:option> </html:select> </td> </tr> <tr> <td height="25" align="right"> </td> <td height="30"><html:submit value="确 定" styleClass="button1"/> <html:reset value="重置" styleClass="button1" /></td> </tr>struts-config.xml里 对它的配置 SSH的配置是没有问题,我的loginAction那边是没事的 </html:form> <form-bean name="insertForm" type="org.apache.struts.action.DynaActionForm"> <form-property name="typeid" type="java.lang.String" /> <form-property name="time" type="java.lang.String" /> <form-property name="from" type="java.lang.String" /> <form-property name="content" type="java.lang.String" /> <form-property name="filename" type="java.lang.String" /> <form-property name="subject" type="java.lang.String" /> </form-bean><action attribute="insertForm" input="/admin/insert.jsp" name="insertForm" parameter="method" path="/newsListType" scope="request" type="org.springframework.web.struts.DelegatingActionProxy" validate="false" > <forward name="news.type.list" path="/newsListType.jsp" redirect="true" /> </action> 哎 现在做毕业设计都用ssh,我们这些做项目的真是没前途 我当初做毕设的时候用的只有struts而已,oracle数据库。myeclipse+tomcat 当初做毕设的时候,JAVA就学过1周,网页设计完全没学过。学校教的和毕设的东西完全脱节/ 我当时做毕业设计的时候 不晓得java是什么东西 楼主~[email protected]谢谢啦~! 这是上述问题的源码,请各位帮忙 为什么在struts2的配置文件里不能这样定义方法名 sax 关于ajax按需取数据的问题 为什么自己编译的Applet不能正常显示? cookie的初级问题!!! struts的帮助文档 Windows2003下的tomcat连接池问题 对实体Bean缓冲池的工作机制的不甚理解? 请问XmlDocument如何序列化 jfreechart问题 j2ee学习
这是 NewsListTypeAction中的方法:
public ActionForward insertNews(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) { News news=null;
String newsid = request.getParameter("newsid");
DynaValidatorForm f = (DynaValidatorForm) form;
if(newsid!=null){
if(LoginAction.validator(request)==false){
return mapping.findForward("news.admin.login");
}
news=manager.getNews(Integer.parseInt(newsid));
} else{
news=new News();
}
news.setFrom((String)f.getString("from"));
news.setContent((String)f.getString("content"));
news.setFilename((String)f.getString("fileName"));
news.setNewsid(Integer.parseInt((String)f.getString("newsid")));
news.setSubject((String)f.getString("subject"));
String time=TimeUtil.getFormatTime("yyy-mm-dd hh:MM:ss");
news.setTime(time);
news.setTypeid(Integer.parseInt((String)f.getString("typeid")));
manager.save(news);
return admin(mapping, form, request, response);}
接下来是jsp:
<html:form action="/newsListType" >
<html:hidden property="method" value="insertNews"/>
<tr>
<td colspan="2" style="padding:5px;"><html:errors/></td>
</tr>
<tr>
<td width="113" height="25" align="right">新闻标题:</td>
<td width="665" height="25"><html:text property="subject" styleClass="input1"/></td>
</tr>
<tr>
<td height="25" align="right">文件:</td>
<td height="25"><html:text property="filename" styleClass="input1"/></td>
</tr>
<tr>
<td height="25" align="right">发布人:</td>
<td height="25"><html:text property="from" styleClass="input1"/></td>
</tr>
<tr>
<td height="25" align="right">新闻内容:</td>
<td height="25">
<html:textarea property="content" cols="80" rows="10"/>
</td>
</tr>
<tr>
<td height="25" align="right">发布日期:</td>
<td height="25"><html:text property="time" styleClass="input1"/></td>
</tr>
<tr>
<td height="25" align="right">新闻类别:</td>
<td height="25"><html:select property="typeid" styleClass="input1" >
<html:option value="1">焦点</html:option>
<html:option value="2">国内</html:option>
<html:option value="3">国际</html:option>
<html:option value="4">娱乐</html:option>
<html:option value="5">体育</html:option>
<html:option value="6">游戏</html:option>
<html:option value="7">更多</html:option>
</html:select>
</td>
</tr>
<tr>
<td height="25" align="right"> </td>
<td height="30"><html:submit value="确 定" styleClass="button1"/> <html:reset value="重置" styleClass="button1" /></td>
</tr>
struts-config.xml里 对它的配置 SSH的配置是没有问题,我的loginAction那边是没事的
</html:form>
<form-bean name="insertForm" type="org.apache.struts.action.DynaActionForm">
<form-property name="typeid" type="java.lang.String" />
<form-property name="time" type="java.lang.String" />
<form-property name="from" type="java.lang.String" />
<form-property name="content" type="java.lang.String" />
<form-property name="filename" type="java.lang.String" />
<form-property name="subject" type="java.lang.String" />
</form-bean>
<action
attribute="insertForm"
input="/admin/insert.jsp"
name="insertForm"
parameter="method"
path="/newsListType"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy" validate="false"
>
<forward
name="news.type.list"
path="/newsListType.jsp"
redirect="true" />
</action>
myeclipse+tomcat
学校教的和毕设的东西完全脱节/
谢谢啦~!