ÇëÎÊ JspÖÐAttributeºÍparameterµÄÇø±ðÔÚÄÄÀ
ÇëÎÊ JspÖÐAttributeºÍparameterµÄÇø±ðÔÚÄÄÀ
ÔÚSSH ÖÐÅäÖÃsturts-config.xml Ê Attribute ÊÇ·ñ¿ÉÒÔÓжà¸ö£¿
parameterÊÇ·ñ¿ÉÒÔʹÓöà¸ö£¿
ÈçºÎÇø·Ö¶þÕßµÄÇø±ð £¿
getParameterÊÇ»ñÈ¡Ò³ÃæÔªËØµÄÖµºÍurlÖеÄÖµ£¬Ö»ÄÜÈ¡µ½×Ö·û´®£¬
getAttributeÊÇ»ñÈ¡±£´æÔÚÏàÓ¦·¶Î§ÄÚµÄÖµ£¬¿ÉÒÔÊǶÔÏ󼯺ϵȣ¬°üÀ¨request,sessionµÈ¡£
SSH¿ò¼Ü¿ª·¢ÖÐÄÜ·ñ Struts-config.xml ÖеÄActionΪʲô²»ÄÜÅäÖÃÁ½¸öparameter£¿£¿
AttributeÊÇÊôÐÔ getǰ±ØÐëÏÈset
parameterÊDzÎÊý ÓɵØÖ·À¸»ò±íµ¥¿Ø¼þÌṩ
..
±§Ç¸£¬ÍüÁ˸æËß´ó¼ÒÁË £¬ÎÒÊÇÓõÄÈý¸ö¿ò¼Ü×öµÄ£¬ÐèÒªÔÚ Struts-config.xml ÅäÖà Attribute¡¢ParameterËùÒÔÓе㲻Ã÷°×£¬ÕâÀïÅäÖõÄparameterΪʲô²»ÄÜÅäÁ½¸öÄØ£¿
ÎÒÏëÔÚURLÖÐ ´«ÈëÁ½¸öÖµ£¬ÈçºÎ´«ÖµÄØ£¿
a.jsp?a=1&b=2
Ïà¹ØÎÊ´ð£º
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
ÎҵijÌÐòÈçÏ£º
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv=&q ......
jspÖÐinclude.incµÄ×÷ÓÃÊÇʲô£¿
include.incɶÒâ˼£¿Ã»Ìý˵¹ý
Java code:
<%include file="include.inc"%>¼ÓÔØÍøÕ¾Ä¿Â¼include.incÎļþÄÚÈÝ
°üº¬Ò»¸ö¾²Ì¬Ò³Ãæ°É···
& ......
ÐÂÊÖ:
tomcat+struts 2.0
jsp Ò³ÃæÖ±½Ó¹ØÁªmodel
ÏÖÔÚÐèÒª¸ù¾Ýmodel(admin)ÀïÃæµÄÒ»¸öitem(id),ÅжÏjspÒ³Ãæ³öÏÖµÄÄÚÈÝ.
´ó¸ÅÁ÷³Ì:
...
<table>
<tr>
<td>
<s:if admin.id is null> ......
JSPÒ³ÃæÖÐÓжà¸öradio°´Å¥
JSPÒ³Ãæ½«²ÎÊýPOST¸øservlet
ÒªÇóÈçÏÂ;
1.Ñ¡ÔñÒ»¸öradio£¬µ÷ÓÃservlet servletÖиù¾Ý²ÎÊýµ÷ÓÃÆäËû½Ó¿Ú£¬³ý·ÇÑ¡ÖиÃradio²¢µã»÷JSPÖеÄʵР......