⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 processnewtopiccontentaction.java

📁 本人大学时大型作业用JAVA做的一个 BBS系统 模式MVC 非struts版 开发工具JCreator Pro 数据库SQL2
💻 JAVA
字号:
package actions;
import javax.servlet.http.*;
import javax.servlet.*;
import java.io.UnsupportedEncodingException;
import java.util.*;
import domain.*;
import servlets.*;
import db.*;
public class ProcessNewTopicContentAction extends Action
{
	private HashMap uris=new HashMap();
	private String uri=null;	
	public String process(ServletContext scx,String path,HttpServletRequest request,HttpServletResponse response)
	{
		scx.log("ProcessNewTopicContentAction");
		try
		{					
			String id=request.getParameter("id");
			String title=new String(request.getParameter("title").getBytes("ISO-8859-1"),"gb2312");
			String content=new String(request.getParameter("content").getBytes("ISO-8859-1"),"gb2312");
			String userName=((BBSUser)request.getSession().getAttribute("user")).getUserName();							
			System.out.print(id);
			TopicDao topics=new TopicDao();
			topics.addTopic(id,title,content,userName);
		}
		catch(UnsupportedEncodingException e)
		{
			e.printStackTrace();
		}	
		uris=(HashMap)scx.getAttribute("actionMap");		
		uri=((ActionMapping)uris.get(path)).getUri();
		return uri;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -