- JSP, , , PHP, -. , (frameworks) (tag library), .
, , , , , JSP. Java , PHP. , , . JSP , , . , 2007 Struts Spring [15]. Hibernate [16]. , , . PHP, .
Java Server Pages , . . (, JSP- ). .
, , JSP- . -, (div) HTML . JSTL, [17]. , , , . JSTL , , .
, , .
<c:choose>
<c:when test=${user.country == Ukraine}>
<p>³ !</p>
</c:when>
<c:when test=${user.country == Russia}>
<p> !</p>
</c:when>
<c:when test=${user.country == Japan}>
<p>Ohayo gozaimasu!</p>
</c:when>
</c:choose>
|
|
2. JSTL
, JSP -.
. - , . , Struts MVC (Model-View-Controller), , , .
. 2. , Struts
, . , , , - , , -. , , JSP. , jsp- XML-. , , , 3.
<action name="Login" class="site.Login">
<result>/MyAccount.jsp</result>
<result name="input">/Login.jsp</result>
</action>
<action name="Registration" >
<result>/Registration.jsp</result>
</action>
<action name="Register" class="site.Register">
<result>/RegistrationSuccess.jsp</result>
<result name="input">/Registration.jsp</result>
</action>
3. Struts
, Hibernate [17].
Spring , [18]. , , , , , - (, -, - ).
JSP , . , -, .