aspose file tools*
The moose likes JSP and the fly likes HTTP ERROR: 500 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "HTTP ERROR: 500 " Watch "HTTP ERROR: 500 " New topic
Author

HTTP ERROR: 500

viral patel
Greenhorn

Joined: Feb 25, 2003
Posts: 16
Hi,
Im trying to process data from a form. I have java bean. And method call validata(). whicj check if any required field is empty.if it its then it send to retry.jsp page. Otherwise send to success.jsp. When i try to use it..it give me erroe saying
HTTP ERROR: 500 /jsp/ac/process.jsp(16,32) Attribute )% has no value
I dont know what is wrong here.
can someone help me here.
Here my code
Process.jsp
<%@ page import="java.util.*" %>
<%!
ResourceBundle bundle =null;
public void jspInit() {
bundle = ResourceBundle.getBundle("forms");
}
%>
<jsp:useBean id="formHandler" class="foo.FormBean" scope="request">
<jsp:setProperty name="formHandler" property="*"/>
</jsp:useBean>
<%
if (formHandler.validate()) {
%>
<jsp:forward page="sucess.jsp")%>"/>
<%
} else {
%>
<jsp:forward page="retry.jsp"/>
<%
}
%>
My bean code:
package foo;
import java.util.*;
public class FormBean {
private String userName;
private String password;
private String firstName;
private String lastName;
private String cName;
private String cAddress;
private String city;
private String state;
private String zipCode;
private String phone;
private String fax;
private String email;
private Hashtable errors;
public boolean validate() {
boolean allOk=true;
if (userName.equals("")) {
errors.put("userName","Please enter your User name");
userName="";
allOk=false;
}
if (password.equals("") ) {
errors.put("password","Please enter a valid password");
password="";
allOk=false;
}
if (firstName.equals("")) {
errors.put("firstName","Please enter your first name");
firstName="";
allOk=false;
}
if (lastName.equals("")) {
errors.put("lastName","Please enter your last name");
lastName="";
allOk=false;
}
if (cName.equals("")) {
errors.put("cName","Please enter your Company name");
cName="";
allOk=false;
}

if (cAddress.equals("")) {
errors.put("cAddress","Please enter your address");
cAdress="";
allOk=false;
}

if (city.equals("")) {
errors.put("city","Please enter your city name");
city="";
allOk=false;
}
if (state.equals("")) {
errors.put("state","Please enter your state name");
state="";
allOk=false;
}
if (zipCode.equals("") || zipCode.length() !=5 ) {
errors.put("zipCode","Please enter a valid zip code");
zipCode="";
allOk=false;
} else {
try {
int x = Integer.parseInt(zip);
} catch (NumberFormatException e) {
errors.put("zipCode","Please enter a valid zip code");
zipCode="";
allOk=false;
}
}
if (phone.equals("")) {
errors.put("phone","Please enter valid Phone number");
phone="";
allOk=false;
}
if (fax.equals("")) {
errors.put("fax","Please enter your fax number");
fax="";
allOk=false;
}
if (email.equals("") || (email.indexOf('@') == -1)) {
errors.put("email","Please enter a valid email address");
email="";
allOk=false;
}

return allOk;
}
public String getErrorMsg(String s) {
String errorMsg =(String)errors.get(s.trim());
return (errorMsg == null) ? "":errorMsg;
}
public FormBean() {
userName="";
password="";
firstName="";
lastName="";
cName="";
cAddress="";
city="";
state="";
zipCode="";
phone="";
fax="";
email="";
errors = new Hashtable();
}
public String getUserName() {
return userName;
}
public String getPassword() {
return password;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public String getCName() {
return cName;
}
public String getCAddress() {
return cAddress;
}
public String getCity() {
return city;
}
public String get State() {
return state;
}
public String getZipCode() {
return zipCode;
}
public String getPhone() {
return phone;
}
public String getFax() {
return fax;
}
public String getEmail() {
return email;
}
public void setUserName(String u) {
userName=u;
}
public void setPassword(String p) {
password=p;
}
public void setFirstName(String fname) {
firstName =fname;
}
public void setLastName(String lname) {
lastName =lname;
}
public void setCName(String company) {
cName =company;
}
public void setCAddress(String address) {
cAddress =address;
}
public void setCity(String c) {
city =c;
}
public void setState(String s) {
state =s;
}
public void setZipCode(String z) {
zipCode=z;
}

public void setPhone(String ph) {
phone=ph;
}
public void setFax(String f) {
fax=f;
}
public void setEmail(String eml) {
email=eml;
}
public void setErrors(String key, String msg) {
errors.put(key,msg);
}
}

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65


Examine this line carefully.
hth,
bear
P.S. In future posts please be sure to enclose your code in the UBB code tags for easier reading.
[ March 18, 2003: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
viral patel
Greenhorn

Joined: Feb 25, 2003
Posts: 16
i found the problem..but thank for anyway
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP ERROR: 500
 
Similar Threads
run-time error
getting error while excuting the jsp page
getting JSP to recognize my bean!!!
Getting the name of the requesting page
HTTP ERROR: 500