GeeCON Prague 2014*
The moose likes Struts and the fly likes Hpp Status 500 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Hpp Status 500" Watch "Hpp Status 500" New topic
Author

Hpp Status 500

greeshma viswarajan
Greenhorn

Joined: Jul 04, 2008
Posts: 9
i got Hpp Status 500 error in my struts 2.0program
my struts.xml file
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
<struts>
<package name="WebApplication6" namespace="/" extends="struts-default">
<action name="Product_input">
<result>/ProductForm.jsp</result>
</action>

<action name="Product_save" class="WebApplication6.Product">
<result>/ProductDetails.jsp</result>
</action>
</package>

</struts>


my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>example/HelloWorld.jsp</welcome-file>
</welcome-file-list>
</web-app>


product.java
import java.io.Serializable;
public class Product implements Serializable {
private String productName;
private String description;
private String price;

public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String execute() {
return "success";
}
}


ProductFrom.jsp
<html>
<head>
<title>Add Product Form</title>
</head>
<body>
<div id="global">
<h3>Add a product</h3>
<form method="post" action="Product_save.action">
Product Name: <input type="text" name="productName"/>
Description: <input type="text" name="description"/>
Price: <input type="text" name="price"/>
<input type="reset"/> <input type="submit" value="Add Product"/>

</form>
</div>
</body>
</html>

ProductDetails.jsp
<html>
<head>
<title>Save Product</title>
</head>
<body>
<div id="global">
<h4>The product has been saved.</h4>

<h5>Details:</h5>
Product Name: ${product.productName}

Description: ${product.description}

Price: $${product.price}
</div>
</body>
</html>
could anyone help me
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please UseCodeTags when posting code or configuration. Unformatted code and configuration is very difficult to read. You can edit your post to include them by using the button.

And disable HTML.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

When you edit that, also make sure to set devMode to true, and turn logging up to DEBUG level. Check for errors on deployment and on form submission. Include the stack trace.
 
GeeCON Prague 2014
 
subject: Hpp Status 500