?
Solved

Struts Submit button woes

Posted on 2006-03-29
3
Medium Priority
?
415 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 -->
                  


0
Comment
Question by:fshtank
3 Comments
 
LVL 11

Expert Comment

by:fargo
ID: 16324676
where is the html:form in the page??

fargo
0
 
LVL 19

Accepted Solution

by:
actonwang earned 1500 total points
ID: 16325209
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
0
 

Author Comment

by:fshtank
ID: 16338360
Thanks actionwang for a clear, precise answer.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome to 2018! Exciting things lie ahead in the world of tech. To start things off, we compiled great member articles on how to stay safe, ways to learn, and much more! Read on to start your new year right.
How do you create a user-centered user experience on your website? And what are some things you should consider in the process?
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question