如何将动态信息从jsp中的<jsp:usebean>中继到servlet?</jsp:usebean>

时间:2012-06-27 16:23:11

标签: java jsp web-applications servlets

我目前正在开发一个项目,用户可以在该项目中查询数据库并将信息返回到新的.jsp页面。

我想让用户验证信息是否正确,然后单击一个按钮,然后将该过程转发给servlet。然后,servlet将获取信息并将其输入到写入命令提示符的代码中。以下是我的能。谁能给我一个方向?

<form name="Push" action="RuntimeExec" method= "Post">
<jsp:useBean id="needsPush" class="bean.SearchBean" scope="request"/>

<table border="2" width="500" height="100" bgcolor="#C0C0C0">
<tr>
<td align="left" width="150"><a name="ions"></a><b>Ions ID: </b></td>
<td><jsp:getProperty name="needsPush" property="XID"/></td>
</tr>
<tr>
<td align="left" width="150"><b>Email: </b></td>
<td><jsp:getProperty name='needsPush' property='EADD'/></td>
</tr>
<tr>
<td align="left" width="150"><b>BES: </b></td>
<td><jsp:getProperty name="needsPush" property="SERV"/></td>
</tr>
</table>

<br/>
<input type="submit" value="Push Token" /> 






public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
                        String Mail = request.getParameter("Email");
                        String Server = request.getParameter("BES");
                        Runtime rt = Runtime.getRuntime();
            RuntimeExec rte = new RuntimeExec();
            StreamWrapper error, output;

            try {
                    System.out.println(Mail);
                    System.out.println(Server);
                        Process proc = rt.exec("java -classpath pushtoken.jar PushToken -h" + Server +" -p8080 -e"+ Mail + " s:\\SecurID_EmailAddresses\\" + Mail +".sdtid"); 

1 个答案:

答案 0 :(得分:0)

很遗憾没人能帮忙。如果有人好奇如何使这项工作,这些是我做的调整......

<form name="Push" action="RuntimeExec" method= "Post">
<jsp:useBean id="needsPush" class="bean.SearchBean" scope="request"/>

<table border="2" width="500" height="100" bgcolor="#C0C0C0">
<tr>
<td align="left" width="150"><a name="ions"></a><b>Ions ID: </b></td>
<td><input type="text" name="XID" value=<jsp:getProperty name="needsPush" property="XID"/>></td>
</tr>
<tr>
<td align="left" width="150"><b>Email: </b></td>
<td><input type="text" name="Email" value=<jsp:getProperty name='needsPush' property='EADD'/>></td>
</tr>
<tr>
<td align="left" width="150"><b>BES: </b></td>
<td><input type="text" name="Server" value=<jsp:getProperty name="needsPush" property="SERV"/>></td>
</tr>
</table>

<br/>
<input type="submit" value="Push Token" /> 

用户显然可以编辑数据,但这不是此项目的问题。