jsp

Passing parameters in a response.sendRedirect() - JSP

不羁的心 提交于 2021-02-17 21:44:10
问题 I am new to Web Technologies. I am trying to do a simple program which ask the user to input a name, if valid the page redirects to another jsp file "RedirectIfSuccessful.jsp" , if invalid the page redirects to "RedirectIfFailed.jsp" . I am using the response.sendRedirect() method to do this. The redirect is working fine. However, I wish to access the name the user inputs in the form from RedirectIfSuccessful and RedirectIfFailed files so that when a valid name is entered the user is

Servlet with JDBC [duplicate]

心已入冬 提交于 2021-02-17 07:11:47
问题 This question already has answers here : The infamous java.sql.SQLException: No suitable driver found (16 answers) Closed 3 years ago . I have a problem with my progect. Files of progect: House.class public class House implements Serializable { //properties ------------------------------------------------------------- private String price; private String square; private String RoomNumbers; //------------------------------------------------------------------------ //getters - settersm Object

Servlet with JDBC [duplicate]

穿精又带淫゛_ 提交于 2021-02-17 07:11:30
问题 This question already has answers here : The infamous java.sql.SQLException: No suitable driver found (16 answers) Closed 3 years ago . I have a problem with my progect. Files of progect: House.class public class House implements Serializable { //properties ------------------------------------------------------------- private String price; private String square; private String RoomNumbers; //------------------------------------------------------------------------ //getters - settersm Object

Send the selected value in jsp custom tag as a parameter

两盒软妹~` 提交于 2021-02-17 05:14:26
问题 I want to send the selected value from A custom tag to B custom tag as a parameter. The value of the B custom tag depends on the value selected in the A custom tag. Please help me..... <li> <label for="classType">A</label> <eco:rndDtlCombo name="rndDtlNm" id="rndDtlNm" rndList="${rndList }" userId="${member.userId}"></eco:rndDtlCombo> </li> <li> <label for="classType2">B</label> <eco:performCombo name="performNm" id="performNm" performList="${performList }"></eco:performCombo> </li> 来源: https

Custom 404 error page not working with Struts 2

北战南征 提交于 2021-02-17 02:47:13
问题 I am converting a JSP/Servlet dynamic web project to Struts 2 and the custom error pages (that previously worked with the JSP/Servlet version) have stopped working. When I induce a 404 error by accessing a non-existent page like abc.jsp , it throws below exception: SEVERE: Servlet.service() for servlet jsp threw exception The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed

how to pull selected radio button in a jsp

让人想犯罪 __ 提交于 2021-02-16 20:18:19
问题 I have two radio buttons, and depending on which one is selected I want to send them to a specific jsp page. I do not know how to pull which button is selected in my java class. Here is the jsp: <form method="post" action="ttp.actions.Sale1Action.action"> <input type="radio" name="radio1" value="packages"checked> packages<br> <input type="radio" name="radio1" value="productions"> productions<br> <input type="submit" value=" next "/> </form> here is the java: public class Sale2Action

Validation exception in struts2 action

余生长醉 提交于 2021-02-15 03:14:55
问题 I have some Action class and try to add a form with validation. But every time when I tried to do it I have got an exception. Action class code: public void validate() { if (name == null || name.trim().equals("")) { addFieldError("name", "The name is required"); } if (surname == null || surname.trim().equals("")) { addFieldError("surname", "Age must be in between 28 and 65"); } } Form code: <s:form action="addnew" method="POST"> <s:textfield label="Name: " name="name"/> <s:textfield label=

Multiple submit buttons in Struts 2 form tag

与世无争的帅哥 提交于 2021-02-13 12:44:10
问题 I'm trying to point a button in my form tag to a different action/action class than the form but it won't work. I read in another thread that this is due to a bug in Struts 2 and that struts.mapper.action.prefix.enabled"="true" should be set, so I did it but it's still the same. I can use a different action pointing to a different method of the same action class that the form is using but when I try specifying a different action class it doesn't work. This works, (jsp) <s:form action="print">

Multiple submit buttons in Struts 2 form tag

为君一笑 提交于 2021-02-13 12:41:47
问题 I'm trying to point a button in my form tag to a different action/action class than the form but it won't work. I read in another thread that this is due to a bug in Struts 2 and that struts.mapper.action.prefix.enabled"="true" should be set, so I did it but it's still the same. I can use a different action pointing to a different method of the same action class that the form is using but when I try specifying a different action class it doesn't work. This works, (jsp) <s:form action="print">

Multiple submit buttons in Struts 2 form tag

本秂侑毒 提交于 2021-02-13 12:41:31
问题 I'm trying to point a button in my form tag to a different action/action class than the form but it won't work. I read in another thread that this is due to a bug in Struts 2 and that struts.mapper.action.prefix.enabled"="true" should be set, so I did it but it's still the same. I can use a different action pointing to a different method of the same action class that the form is using but when I try specifying a different action class it doesn't work. This works, (jsp) <s:form action="print">