Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÎÒ¿ª·¢Ò»¸öjspϵͳʱÅöµ½µÄÎÊÌâ

1.No getter method for property name problem(struts)
ÓÐÒ»ÖÖ¿ÉÄÜÊÇBeanûÓÐдÏàÓ¦µÄget·½·¨£¬ÀýÈç±äÁ¿userNameµÄget·½·¨ÊÇgetUserName£»
»¹ÓоÍÊÇÕâ¸öBeanΪ¿Õ£»
2.
MyEclipseµÄ×Ô¶¯Ìí¼ÓstrutsºÍhibernate¹¦Äܲ»ÄÜ·µ»Ø£¬Çë×¢Ò⣡
ËùÒÔÎÒÏÈʹÓÃMyEclipseµ¼ÈëstrutsºÍhibernate£¬È»ºó½«ËüÃǵÄjarµ¼Èëµ½ÁíÍâÒ»¸öн¨µÄ¹¤³Ì£¬ÕâÊÇÎҾͲ»ÐèÒªMyeclipseÀ´¸øÎÒ¹ÜÀíÒÀÀµÁË¡£
3
.ÔÚÔö¼Ó¶Ôstruts taglibÖ§³Öʱ£¬Ç뽫¶ÔÓ¦µÄtldÎļþ×·¼Óµ½web.xmlÎļþÖÐÈ¥£º
ÀýÈ磺
<jsp-config>
  <taglib>
    <taglib-uri>http://struts.apache.org/tags-bean </taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld </taglib-location>
    </taglib>
</jsp-config>
4.
Èç¹û³ö´í˵ij¸ötagÔÚtldÎļþÖÐûÓУ¬Ôò˵Ã÷×Ô¼ºÔÚjspÎļþÖÐʹÓõÄtagºÍʹÓõÄstruts taglib°æ±¾²»Ò»ÖÂ
ÀýÈ磺ÔÚstruts1.1ÖеÄhtml:locale£¬ÔÚstruts1.2ÖиÄΪhtml:lang
5.
struts tagÖпÉÒÔʹÓÃscriptlets£¬µ«ÊÇÔÚscriptletsÖв»ÄÜʹÓÃstruts tag¡£
Any Struts tag will work only if you place it directly in the JSP, not if you generate it through a scriptlet. To understand why it won't work to generate it in a scriptlet.
JSP life cycle:
    * The JSP interpreter reads the JSP file, including any custom tags such as Struts tags and converts everything to Java source code
    * It then compiles it into a class file
    * It executes the code, rendering a response in plain HTML and sending it back to the browser.
    * It is only at this point that the scriptlet code you inserted gets executed. It is now too late in the cycle to insert any custom tags, since they've already been interpreted by this point.
6. it is illegal according to JSP specification to nest one tag within another as an attribute.
There are two options:
1) You evaluate bean:write and then substitute it into html:text.
2) Use Struts-EL tags. They let you use expression language to get a bean value and substitute it in another tag.
Unless yo


Ïà¹ØÎĵµ£º

JSPÒ³ÃæÌøת´óÈ«

JSPÒ³ÃæÌøת´óÈ«
JSPÖеÄÌøת£º
(1). forward()·½·¨
    ʹÓõ½javax.servlet.RequestDispatcherÀà
    RequestDispatcher rd = getServletContext().getRequestDispatcher("url");
    rd.forward(requestVar,requestVar); //´«µÝservletµÄÈë¿Ú²ÎÊý
   ......

½â¾öJspÒ³ÃæURLÖд«µÝ²ÎÊýÂÒÂëµÄ·½·¨

JspÒ³ÃæÔÚURLÖд«µÝ²ÎÊý»á³öÏÖÂÒÂë
½â¾ö·½·¨ÈçÏ£º
Ò»¡¢Ê¹Óøü¸ÄTomcatµÄ·½·¨¡£Õâ¸ö·½·¨¼òµ¥£¬µ«ÊÇÐèÒª¸Ä¶¯µÄµØ·½ÊÇ·þÎñÆ÷Èí¼þ¼¶±ðµÄ£¬Èç¹ûÉÔ΢±ä¶¯ÏµÍ³½«ÎÞ·¨ÕýȷתÂ룬ÒÆÖ²ÐÔ²»¸ß¡£
1¡¢À´µ½tomcatĿ¼£¬ÕÒµ½confĿ¼ÏµÄserver.xmlÎʼۣ¬´ò¿ª£¬ÕÒµ½<Connector>±êÇ©£¬ÔÚ×îºóÌí¼ÓURIEncoding=’GBK’£¬Ð ......

jsp¼¸ÖÖ·½·¨

1.±ØÐë¼Ì³Ð×ÔHttpServlet
  2.±ØÐëʵÏÖdoGet()»òÕßdoPost()
  3.±ØÐëÔÚweb.xmlÖÐÅäÖÃServlet
  <servlet>
  <servlet-name> </servlet-name>
  <servlet-class> </servlet-class>
  </servlet>
  <servlet-mapping>
  ......

JSPʵÀýÈý¡¢sql·ÖÒ³(1)

index.jsp
<%@ page language="java" import="java.sql.*" import="java.lang.*" import="java.util.*" pageEncoding="GB2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%!
& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ