⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 item.jsp

📁 Struts入门的一个好例子 Struts入门的一个好例子
💻 JSP
字号:
<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/struts/jsp/include/taglib.jsp"%>

<html>
  <head>
    <title><bean:message key="daily.title" /></title>
  </head>
  <body>
    <html:form action="/daily" onsubmit="return validateDailyForm(this);">
      <h1>
        <logic:equal name="flag" value="add">
          <bean:message key="common.add" />
        </logic:equal>
        <logic:equal name="flag" value="addSuccess">
          <bean:message key="common.add.success" />
        </logic:equal>
        <logic:equal name="flag" value="upd">
          <bean:message key="common.upd" />
        </logic:equal>
        <logic:equal name="flag" value="updSuccess">
          <bean:message key="common.upd.success" />
        </logic:equal>
        <logic:equal name="flag" value="dsp">
          <bean:message key="common.dsp" />
        </logic:equal>
        <logic:equal name="flag" value="del">
          <bean:message key="common.del" />
        </logic:equal>
      </h1>
      <hr />
        
      <logic:messagesPresent message="true">
        <ul>
        <html:messages id="message" message="true">
          <li><bean:write name="message" ignore="true" /></li><br />
        </html:messages>
        </ul>
      </logic:messagesPresent>
      
      <bean:message key="daily.daily_date" />
      <logic:equal name="flag" value="add">
        <html:text property="daily_date" />
      </logic:equal>
      <logic:equal name="flag" value="upd">
        <html:text property="daily_date" />
        <html:hidden property="id" />
      </logic:equal>
      <logic:equal name="flag" value="addSuccess">
        <bean:write name="dailyForm" property="daily_date"/>
      </logic:equal>
      <logic:equal name="flag" value="updSuccess">
        <bean:write name="dailyForm" property="daily_date"/>
      </logic:equal>
      <logic:equal name="flag" value="dsp">
        <bean:write name="dailyForm" property="daily_date"/>
      </logic:equal>
      <logic:equal name="flag" value="del">
        <bean:write name="dailyForm" property="daily_date"/>
        <html:hidden property="id" />
      </logic:equal>
      <html:errors property="daily_date" />
      <br />
      
      <bean:message key="daily.daily_weather" />
      <logic:equal name="flag" value="add">
        <html:text property="daily_weather" />
      </logic:equal>
      <logic:equal name="flag" value="upd">
        <html:text property="daily_weather" />
      </logic:equal>
      <logic:equal name="flag" value="addSuccess">
        <bean:write name="dailyForm" property="daily_weather"/>
      </logic:equal>
      <logic:equal name="flag" value="updSuccess">
        <bean:write name="dailyForm" property="daily_weather"/>
      </logic:equal>
      <logic:equal name="flag" value="dsp">
        <bean:write name="dailyForm" property="daily_weather"/>
      </logic:equal>
      <logic:equal name="flag" value="del">
        <bean:write name="dailyForm" property="daily_weather"/>
      </logic:equal>
      <html:errors property="daily_weather" />
      <br />
      
      <bean:message key="daily.daily_pos" />
      <logic:equal name="flag" value="add">
        <html:text property="daily_pos" />
      </logic:equal>
      <logic:equal name="flag" value="upd">
        <html:text property="daily_pos" />
      </logic:equal>
      <logic:equal name="flag" value="addSuccess">
        <bean:write name="dailyForm" property="daily_pos"/>
      </logic:equal>
      <logic:equal name="flag" value="updSuccess">
        <bean:write name="dailyForm" property="daily_pos"/>
      </logic:equal>
      <logic:equal name="flag" value="dsp">
        <bean:write name="dailyForm" property="daily_pos"/>
      </logic:equal>
      <logic:equal name="flag" value="del">
        <bean:write name="dailyForm" property="daily_pos"/>
      </logic:equal>
      <html:errors property="daily_pos" />
      <br />
      
      <bean:message key="daily.daily_content" />
      <logic:equal name="flag" value="add">
        <html:textarea property="daily_content" rows="10" />
      </logic:equal>
      <logic:equal name="flag" value="upd">
        <html:textarea property="daily_content" rows="10" />
      </logic:equal>
      <logic:equal name="flag" value="addSuccess">
        <bean:write name="dailyForm" property="daily_content"/>
      </logic:equal>
      <logic:equal name="flag" value="updSuccess">
        <bean:write name="dailyForm" property="daily_content"/>
      </logic:equal>
      <logic:equal name="flag" value="dsp">
        <bean:write name="dailyForm" property="daily_content"/>
      </logic:equal>
      <logic:equal name="flag" value="del">
        <bean:write name="dailyForm" property="daily_content"/>
      </logic:equal>
      <br />
      
      <logic:equal name="flag" value="add">
        <html:submit onclick=
          "document.forms[0].action = document.forms[0].action+'?method=add'">
          <bean:message key="common.add" />
        </html:submit>
      </logic:equal>
      <logic:equal name="flag" value="upd">
        <html:submit onclick=
          "document.forms[0].action = document.forms[0].action+'?method=upd'">
          <bean:message key="common.upd" />
        </html:submit>
      </logic:equal>
      <logic:equal name="flag" value="del">
        <html:submit onclick=
          "document.forms[0].action = document.forms[0].action+'?method=del'">
          <bean:message key="common.del" />
        </html:submit>
      </logic:equal>
      <logic:equal name="flag" value="addSuccess">
        <html:submit>
          <bean:message key="common.show.all" />
        </html:submit>
      </logic:equal>
      <logic:equal name="flag" value="updSuccess">
        <html:submit>
          <bean:message key="common.show.all" />
        </html:submit>
      </logic:equal>
      <logic:equal name="flag" value="dsp">
        <html:submit>
          <bean:message key="common.show.all" />
        </html:submit>
      </logic:equal>
    </html:form>
  </body>
  <logic:equal name="flag" value="add">
    <html:javascript formName="dailyForm" dynamicJavascript="true" staticJavascript="true" />
  </logic:equal>
  <logic:equal name="flag" value="upd">
    <html:javascript formName="dailyForm" dynamicJavascript="true" staticJavascript="true" />
  </logic:equal>
  
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -