We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Struts Submit button woes

fshtank
fshtank asked
on
Medium Priority
435 Views
Last Modified: 2010-05-18
I am creating a simple, new JSP page with a textbox, a drop down, and a submit button.  I am making use of Apache struts.  I have a form object which contains a prNumber and revision property, both strings.  The form object extends a parent object which has a submitButton property.  All of these form properties have the appropriate setters and getters.

The issue at hand is that I get a 500 error when I add the line for the submit button.  When I comment out that line, the page loads.  Uncommented, it gets the 500 error.  See the code listed below.

My question is basically:  what feedback can you provide me on this submit button?  Thanks




<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>

<%
//SECTION 1: lists all the include files for struts
//===================================================================================================
%>
<%@ page language="java" %>
<%@ page import="com.something.jsp.JspColor,
com.something.action.Actions;"%>

<%  
//SECTION 2: Define all the local varables
//===================================================================================================
%>

<%
//SECTION 3: lists all the include files for header
//===================================================================================================
%>
<!-- Header Begins -->                              
<jsp:include  page="/WEB-INF/pages/jspHeader.jsp"  flush="true"/>
<!-- Header Ends -->

<%
//SECTION 4: Coding Area
//===================================================================================================
%>

<!-- DEFINE TABLE HEADER -->
<jsp:include  page="/WEB-INF/pages/mainmenu.jsp"  flush="true"/>
<!-- END TABLE HEADER -->

<!-- DEFINE ERROR MESSAGE AREA -->
<html:errors />
<!-- END ERROR MESSAGE AREA -->

<!-- DEFINE MESSAGE AREA -->
<html:messages id="messages" name="AdminDeletePrForm" message="true" header="messages.header" footer="messages.footer">
 <bean:write name="messages" />
</html:messages>
<!-- END MESSAGE AREA -->

<!--  DATA AREA -->

<% //changes column colors
String SLATE = "#E0E0E0";
String WHITE = "#E9E9E9";
String [] colors = {WHITE, SLATE};
JspColor jspColor = new JspColor (colors);
%>

<nested:text name="AdminDeletePrForm" property="prNumber" size="6" maxlength="6"/>
<nested:select name="AdminDeletePrForm" property="revision">
      <html:option value="20">IN WORK PR</html:option>
      <html:option value="70">ENTIRE PR</html:option>
</nested:select>

<html:submit value="<%= Actions.DELETEPR %>" name="AdminDeletePrForm" property="submitButton" styleClass="sbutton" />

<%
//===================================================================================================
//SECTION 5:  ePRO Footer
//===================================================================================================
%>
<!-- Footer Begins -->                              
<jsp:include  page="/WEB-INF/pages/jspFooter.jsp"  flush="true"/>
<!-- Footer Ends -->
                  


Comment
Watch Question

Commented:
where is the html:form in the page??

fargo
fargo is right. Internal error is due to lack of <html:form ...>, you need to do as:

<html:form>

    <html:textbox .../>
     <html:checkbox ../>

     <html:submit .../>

</html:form>

most of html:xx tags need to inside <html:form ...> otherwise it will complain that there is no form object in the request session or session.

Acton

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thanks actionwang for a clear, precise answer.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.