Struts,Spring和一些其他框架实现了MVC架构,以将信息的表示与用户与其的交互分开.
任何人都可以在Java EE中解释或给我一个链接吗?
如果不使用框架,我如何创建MVC应用程序以及需要哪些设计模式?
我正在考虑在我的J2EE应用程序中实现Front Controller.您能否提供相同的链接(包含源代码示例)和任何标准?
最好的祝福
我想知道什么是url编码.我有2个jsp页面和一个servlet.当我运行应用程序时,显示的URL是:
http://localhost:8080/myproject/index.jsp
哪里
index.jsp:
<form action="Myservlet" method="post">
<input type="text" name="mytext" id="mytext"/>
<input type="submit" value="submit"/>
</form>
Run Code Online (Sandbox Code Playgroud)
单击提交按钮后,显示的URL为:
http://localhost:8080/myproject/Myservlet
URL编码是什么意思?我该如何编码网址?
从index.jsp去Myservlet再到result.jsp
Myservet#doPost //我需要在这里进行URL编码吗?如果有,怎么样?
fetching data from db.......
....................
String nextJSP = "/result.jsp";
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(nextJSP);
dispatcher.forward(request,response);
Run Code Online (Sandbox Code Playgroud)
result.jsp中
displays data here