struts

rewrite URL to affect “save as” filename

谁说胖子不能爱 提交于 2019-12-11 15:49:09
问题 My application is in JSP/Struts and running on WebSphere. I don't have access to the server /really/ so I'm trying to do all this from within the app itself (Struts actions & config, JSP, etc). I have a page that displays links for PDF documents that the user might want to look at. When they click on the link, it is forwarded to the 'document view' STRUTS action which performs the work to retrieve the PDF from the back-end system and then displays the PDF in the browser window. This all works

Hibernate and DB2 data fetching

蓝咒 提交于 2019-12-11 15:25:39
问题 I am using struts and hibernate application. I have a problem while fetching records from DB2 via hibernate. I am getting this error 14:22:17,804 WARN [JDBCExceptionReporter] SQL Error: -204, SQLState: 42704 14:22:17,804 ERROR [JDBCExceptionReporter] DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.TABLENAME, DRIVER=3.57.82 14:22:17,804 WARN [JDBCExceptionReporter] SQL Error: -727, SQLState: 56098 14:22:17,804 ERROR [JDBCExceptionReporter] DB2 SQL Error: SQLCODE=-727, SQLSTATE

Accessing a form variable inside javascript

感情迁移 提交于 2019-12-11 15:23:30
问题 I have a code like this <html> <head>Title <script> function callme() { alert("Hi"); document.test.action ="testAction.do"; alert(document.getElementById("option").value); alert('<%=request.getParameter("option")%>'); } </script> } </head> <body> <FORM method="post" name="test" > <select name="option" id="option"> <option>1</option> <option>2</option> </select> <input type="submit" value="Submit" onClick="callme()"> </form> </body> </html> This is a sample jsp code of what I have to do.The

Load div using Struts 2 jQuery

隐身守侯 提交于 2019-12-11 14:38:39
问题 I am creating a struts based application and i want to load a div based on content in a sj:textfield. I am using struts jquery plugin. The div has to be loaded by passing the textfield contents to a struts action. Can anyone tell me how to do so since I could not find any instance of this anywhere. 回答1: i am not sure, if i got u right. but i will give a try. check out the code below <s:form action="action"> <sj:textfield name="name" value="value" label="label/> <sj:submit targets="myResultDiv

Best download file with struts 1.1 method

邮差的信 提交于 2019-12-11 13:39:33
问题 for a web application builded on struts and jsp technologies , i 'm looking for a good example wich explains how to download files from the server side 回答1: i manage to do it with this few lines of code : just add this to your action : OutputStream out = response.getOutputStream(); response.setContentType("application/rtf"); FileInputStream in = new FileInputStream("your_file_path"); byte[] buffer = new byte[4096]; int length; while ((length = in.read(buffer)) > 0){ out.write(buffer, 0,

retrieve multiple inputs of the same name from jsp to struts

给你一囗甜甜゛ 提交于 2019-12-11 13:39:18
问题 I would like to ask how to retrieve the values of the same name in a jsp form inside a loop to the Action class in struts without using the request.getParameterValues("screenName") when I click the SAVE button using the ACtionForm. Here is the sample jsp code that I would like to retrieve the name "screenName" from the inside the loop: <form action="EditScreeningServlet" method="post"> <input type = "hidden" name ="applicantNumber" value="${infoObj.applicantNumber}" > <table> <c:forEach var=

Struts - Exception - The Struts dispatcher cannot be found

淺唱寂寞╮ 提交于 2019-12-11 11:53:26
问题 I am using Struts 2.1.8.1 . I want to use tags, supplied by struts , im my jsp pages. e.g <%@ taglib prefix="html" uri="/struts-tags" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Transfer Program - Login</title> </head> <body> <html:form action="/loginaction.do" method="post"> Username:<html:text name="username"></html:text> </html:form> <

Two radio buttons are selecting at once

萝らか妹 提交于 2019-12-11 11:48:37
问题 i am adding one more radio button in a div of jsp page. But the newly added radio button is selecting always and when i click on second radio button, it is also going to select. is there any script to write to this. <div style="padding-left:15px"> <div> Entry Mode Code was: </div> <div style="padding-left:30px"> <div> <html:radio name="caseForm" property="questionnaire.RP0062.posEntryModeCd" value="A" styleId="posEntryModeCda"> 05 - Chip Card read (data is reliable)</html:radio> </div> <div>

Error in creating jsp file

拜拜、爱过 提交于 2019-12-11 10:52:36
问题 <%@taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%> <%@taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> I'm creating jsp file in eclipse it shows error in directive it does not accept the uri which I mentioned above. 回答1: from your question you used Struts Tag Libraries Automatic Configuration this is how it should be done Struts Tag Libraries Configuration automatic and manual This is the easy way, and used in Struts version 1.2, 1.3 and Servlet

deploy struts app on jboss

拈花ヽ惹草 提交于 2019-12-11 10:17:21
问题 I'm working through some struts tutorials, and here's one of the ones I'm using: http://www.vaannila.com/struts/struts-example/struts-login-page-example-1.html I downloaded the "source + lib" link at the bottom of that page, I copied the Example2 folder from the zip to my webapps folder under tomcat, and everything works as advertised. However, when I try to take this same Example2 folder and copy it to my jboss 4.2.3 default\deploy folder, it doesn't work. Sorry for such a newbie question,