aspose file tools
The moose likes Struts and the fly likes org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException " Watch "org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException " New topic
Author

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException

umesh annegirikar
Greenhorn

Joined: May 09, 2011
Posts: 18
In my code i have got the following exception

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: "UDHC_COUNTRY_MODEL" in scope: "session"
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:538)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:412)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: "UDHC_COUNTRY_MODEL" in scope: "session"
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:865)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
org.apache.jsp.Country_jsp._jspService(Country_jsp.java:375)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

javax.servlet.jsp.JspException: Cannot find bean: "UDHC_COUNTRY_MODEL" in scope: "session"
org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:866)
org.apache.struts.taglib.bean.DefineTag.doEndTag(DefineTag.java:219)
org.apache.jsp.Country_jsp._jspService(Country_jsp.java:178)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.33 logs.

My country.jsp code


<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.ArrayList"%>
<%@page import="com.udhc.model.City"%>
<%@page import="com.udhc.model.Country"%>
<%@page import="com.udhc.model.State"%>

<%@page import="com.udhc.config.ApplicationConstant"%>
<%@page import="com.udhc.model.User"%>
<%@page import="com.udhc.model.Professional"%>
<%@page import="org.apache.struts.Globals"%>


<jsp:include page="Header.jsp"></jsp:include>

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

<script type="text/javascript" >
function addCountry(tableID)
{
var table = document.getElementById(tableID);
var rowCount = table.rows.length;

var row = table.insertRow(rowCount);

var cell1 = row.insertCell(0);
var cell5;
cell1.innerHTML = "<input type='text' name='text_c"+rowCount+"' class=\"textfield\"/>";

cell5.innerHTML = "<a href=\"#\" color=\"red\" onClick=\"javascript:addToList(this);\" >Add</a>";
}

function getUDHCCountry(cId)
{
document.forms[0].countryId.value=cId;
document.forms[0].nextStep.value = "getCountry";
document.forms[0].action = "Admin.do";
document.forms[0].submit();
}

function addUDHCCountry(cId)
{
document.forms[0].countryId.value=cId;
document.forms[0].nextStep.value = "addCountry";
document.forms[0].action = "Admin.do";
document.forms[0].submit();
}
</script>


<input type="hidden" name="countryId"></input>
<bean:define id="professionalModel" name="UDHC_USER_MODEL" scope="session"></bean:define>
<bean:define id="countryModel" name="UDHC_COUNTRY_MODEL" scope="session"></bean:define>
<div><a href="Admin_MasterManagement.jsp">Back</a></div>
<table width="100%" class="back_img" height="300">
<logic:messagesPresent message="true">
<tr>
<td valign="top" style="height: 20px;">
<html:messages id="message" message="true">
<div class="success">
<bean:write name="message"/>
</div>
</html:messages>
</td>
</tr>
</logic:messagesPresent>
<tr valign="top">
<td valign="top" align="center">
<logic:present name="COUNTRY_LIST">
<div style="height: 480px; overflow: auto;">
<table width="80%" class="border" style="margin-top: 60px;">
<tr valign="top">
<td align="left" valign="top" colspan="8"><b><u>Professional List : </u></b></td>
</tr>
<tr class="background1" valign="top" style="font-weight: bold;">
<td width="5" align="center">Sr.No</td>
<td width="30" align="center">Name</td>
<td width="10" align="center">Short Name</td>
<td width="20" align="center">ISO Code</td>
<td width="10" align="center">Currency</td>
</tr>
<% int i=0; %>
<logic:iterate id="countryList" name="COUNTRY_LIST">
<tr>
<td width="5" align="left"><%=++i%></td>
<td width="30" align="left"><bean:write name="countryList" property="name" /></td>
<td width="10" align="center"><bean:write name="countryList" property="shortName" /></td>
<td width="20" align="left"><bean:write name="countryList" property="isoCode" /></td>
<td width="10" align="left"><bean:write name="countryList" property="currency" /></td>
</tr>
</logic:iterate>
</table>
</div>
</logic:present>
<logic:notPresent name="COUNTRY_LIST">
<b>Country List is empty.</b>
</logic:notPresent>
</td>
<td valign="top">
<a href="javascript:addCountry('countries')">Add Country</a>
</td>
</tr>

</table>


<jsp:include page="Footer.jsp"></jsp:include>
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException
 
Similar Threads
Struts 1.2 Cannot find bean org.apache.struts.taglib.html.BEAN
Error comes whilke compiling the jsp page
To call and load javascript in struts jsp.
Displaying Database values on jsp page in struts 1.3
calling the struts action on jquery button click