📄 editconceptstr.jsp
字号:
<%@ page language="java" %><%@ page import="java.util.ArrayList" %><%@ page import="javax.naming.InitialContext" %><%@ page import="org.impact.stars.conceptmd.concept.ejb.ConceptLocal" %><%@ page import="org.impact.stars.conceptmd.concept.ejb.ConceptLocalHome" %><%@ page import="org.impact.stars.conceptmd.conceptstr.ejb.ConceptstrLocal" %><%@ page import="org.impact.stars.conceptmd.conceptstr.ejb.ConceptstrLocalHome" %> <html><head><title>Container-Managed Persistence Demo</title></head><body bgcolor="white"><center><h2>Container-Managed Persistence Demo</h2><%String cid = request.getParameter("cid");ConceptstrLocal conceptstr = null;try { InitialContext ic = new InitialContext(); Object o = ic.lookup("java:comp/env/ConceptstrBeanRef"); ConceptstrLocalHome home = (ConceptstrLocalHome) o; conceptstr = home.findByPrimaryKey(cid);} catch(Exception e) { e.printStackTrace(); out.println(e.toString());}String removeConceptstr = request.getParameter("removeConceptstr");if ("Remove".equals(removeConceptstr)) { conceptstr.remove();}else {String conceptID = request.getParameter("conceptID");String name = request.getParameter("name");String parentID = request.getParameter("parentID");String type = request.getParameter("type");String pstakeholder = request.getParameter("pstakeholder");String shared = request.getParameter("shared");String ptime = request.getParameter("ptime");String definition = request.getParameter("definition");String description = request.getParameter("description");if (conceptID != null && !"".equals(conceptID)) { try { InitialContext ic = new InitialContext(); Object o = ic.lookup("java:comp/env/ConceptBeanRef"); ConceptLocalHome home = (ConceptLocalHome) o; ConceptLocal concept = home.create(cid,conceptID,name,parentID,type,pstakeholder, shared, ptime, definition, description ); } catch(Exception e) { e.printStackTrace(); out.println("Create new concept FAILED : " + e.toString()); }}%><table border=10> <tr> <td>Conceptstr ID: </td> <td><%=conceptstr.getConceptstrID()%></td> </tr> <tr> <td>Name: </td> <td><%=conceptstr.getName()%></td> </tr> <tr> <td>ProjectID: </td> <td><%=conceptstr.getProjectID()%></td> </tr><%ArrayList concepts = conceptstr.getConceptList();for (int i = 0; i < concepts.size(); i++) { ConceptLocal concept = (ConceptLocal)concepts.get(i);%><tr> <td>Concept [<%=concept.getConceptID()%>]</td> <td><%=concept.getName()%></td></tr><%}%></table><p><form method="post" ation="/conceptstr/editConceptstr.jsp?cid=<%=cid%>"><input type="submit" name="removeConceptstr" value="Remove"></form><p>Add an concept:<p><form method="post" action="/conceptstr/editConceptstr.jsp?cid=<%=cid%>"><table border=10> <tr> <td>Concept ID:</td> <td><input type="text" name="conceptID" size="11" value=""></td> </tr> <tr> <td>Street: </td> <td><input type="text" name="name" size="40" value=""></td> </tr> <tr> <td>City: </td> <td><input type="text" name="parentID" size="25" value=""></td> </tr> <tr> <td>State: </td> <td><input type="text" name="shared" size="25" value=""></td> </tr> <tr> <td>Zip: </td> <td><input type="text" name="type" size="25" value=""></td> </tr></table><p><input type="submit" name="submit" value="Add Concept"><p></form><% } %><hr>[<a href="/conceptstr/index.html">HOME</a>]</center></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -