对了,我还不想用STRUTS的FORM,呵呵

解决方案 »

  1.   

    JSTL里没有form tag,不过你可以直接写html。 STRUTS+JSTL是很不错的,我刚做完一个项目就是用这个的。  有什么问题你说呀? 发的话不方便。
      

  2.   

    回2楼:我就是想直接写HTML的FORM,呵呵公司不用JSTL,就用STRUTS1.2,我是自己想练习着做点东西,没人教,写出来的东西都是表面的所以想看看人家的项目是怎么做的,所以具体的问题也没有啊,现在处于迷茫期呢,呵呵~~如果项目的代码不方便发的话,能不能挑出一个功能的发给我呢,一条线上用到的各个类,和配置,我只是想学学这样的项目是如何开发的
      

  3.   

    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    <%@ page language="java" contentType="text/html; charset=GB18030"
        pageEncoding="GB18030"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="pageStyle.css"/>
    <meta http-equiv="Content-Type" content="text/html; charset=GB18030">
    <title>Online Publication Management System</title>
    </head>
    <body>
    <%@ include file="pageFrame.jsp" %>
    <div id="content">
    <h2>Author List</h2>
    <c:if test="${authorPageNumber == null}">
    <c:set var="authorPageNumber" value="0"/>
    </c:if>
    <html:form action="/AuthorOperation">
    <c:forEach var="author" items="${pagingAuthors[authorPageNumber]}">
    <c:url value="AuthorOperation.do" var="authorDetailURL">
    <c:param name="authorId" value="${author.id}"/>
    <c:param name="read" value="read"/>
    </c:url>
    <a href='<c:out value="${authorDetailURL}"/>'> <c:out value="${author.firstname}"/> <c:out value="${author.middlename}"/> <c:out value="${author.surname}"/></a>
    <div align=right><html:checkbox property="authorIds" value="${author.id}"/></div>
    </c:forEach>
    <table><tr>
    <td><html:submit property="delete" value="Delete Authors"></html:submit></td>
    <td><html:submit property="create" value="Create Author"></html:submit></td>
    </tr></table>
    </html:form>
    <html:form action="AuthorManagement">
    <table><tr>
    <td><html:text property="keyword"/></td>
    <td><html:submit property="search" value="Search Authors"/></td>
    </tr></table>
    </html:form>
    <c:if test="${numberOfAuthorPages > 1}">
    &lt;
    <c:forEach var="i" begin="1" end="${numberOfAuthorPages}">
    <c:url value="/AuthorManagement.do" var="authorListURL">
    <c:param name="authorPageNumber" value="${i-1}"/>
    </c:url>
    <c:if test="${i - 1 != authorPageNumber}">
    <a href='<c:out value="${authorListURL}"/>'><c:out value="${i}"/></a>
    </c:if>    
    <c:if test="${i - 1 == authorPageNumber}">
    <c:out value="${i}"/>
    </c:if>  
    <c:if test="${i != numberOfAuthorPages}">|</c:if>        
    </c:forEach>
    &gt;
    </c:if>
    </div>
    </body>
    </html>
      

  4.   

    cl55:你的这个JSP还是用了STRUTS的FORM TAG,那是不也用了FORM BEAN了??这样混着用感觉好乱啊~~
      

  5.   

    我是用了form tag,不过你不喜欢用就直接把<html:form> 换成<form>,  <html:text> 换成<input type="text">, <html:submit> 换成<input type="submit"> 就行了。既使你用了<form>也一样可以用form bean的。