kavitha kandula

Greenhorn
+ Follow
since Aug 11, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by kavitha kandula

Hi,

I would like to know wheather ActionServlet class can be subclassed and this name can be used instead of ActionServlet in struts-config.xml


Thax for the reply in advance
16 years ago
The jar files corectly belongs to struts version which iam using but not able to trace the problem
16 years ago
Hi,

Yes i think the names should be validation.xml and validator-rules.xml.
They are spelled correctly but still getting the error
16 years ago
Hi,

I devloped a small struts project using Netbeans IDE for client side validation.

I got the below error.i have commons-validator.jar in the classpath.



org.apache.jasper.JasperException: ValidatorResources not found in application scope under key "org.apache.commons.validator.VALIDATOR_RESOURCES"
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)


root cause

javax.servlet.ServletException: ValidatorResources not found in application scope under key "org.apache.commons.validator.VALIDATOR_RESOURCES"
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.Address_jsp._jspService(Address_jsp.java:99)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)


root cause

javax.servlet.jsp.JspException: ValidatorResources not found in application scope under key "org.apache.commons.validator.VALIDATOR_RESOURCES"
org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(JavascriptValidatorTag.java:373)
org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:349)
org.apache.jsp.Address_jsp._jspx_meth_html_javascript_0(Address_jsp.java:281)
org.apache.jsp.Address_jsp._jspx_meth_html_form_0(Address_jsp.java:140)
org.apache.jsp.Address_jsp._jspService(Address_jsp.java:89)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)


Here with specifying the struts-config.xml
<?xml version="1.0" encoding="UTF-8" ?>


<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<struts-config>
<form-beans>
<form-bean name="AddressFormBean" type="com.myapp.struts.AddressFormBean"/>


</form-beans>

<global-exceptions>

</global-exceptions>

<global-forwards>
<forward name="Client" path="/Address.jsp"/>

<forward name="welcome" path="/Welcome.do"/>
</global-forwards>

<action-mappings>
<action input="/Address.jsp" name="AddressFormBean" path="/AddressJavascriptValidation" scope="session"
type="com.myapp.struts.AddressAction">
<forward name="SUCCESS" path="/Results.jsp"/>

</action>
<action path="/Welcome" forward="/welcomeStruts.jsp"/>
</action-mappings>




<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>

<message-resources parameter="com/myapp/struts/ApplicationResource"/>

<!-- ========================= Tiles plugin ===============================-->
<!--
This plugin initialize Tiles definition factory. This later can takes some
parameters explained here after. The plugin first read parameters from
web.xml, thenoverload them with parameters defined here. All parameters
are optional.
The plugin should be declared in each struts-config file.
- definitions-config: (optional)
Specify configuration file names. There can be several comma
separated file names (default: ?? )
- moduleAware: (optional - struts1.1)
Specify if the Tiles definition factory is module aware. If true
(default), there will be one factory for each Struts module.
If false, there will be one common factory for all module. In this
later case, it is still needed to declare one plugin per module.
The factory will be initialized with parameters found in the first
initialized plugin (generally the one associated with the default
module).
true : One factory per module. (default)
false : one single shared factory for all modules
- definitions-parser-validate: (optional)
Specify if xml parser should validate the Tiles configuration file.
true : validate. DTD should be specified in file header (default)
false : no validation

Paths found in Tiles definitions are relative to the main context.
-->
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
</plug-in>

<!-- ========================= Validator plugin ================================= -->
<!-- Validator plugin -->

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>


</struts-config>


web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
</jsp-config>
</web-app>


Thanks in Advance
[ September 17, 2007: Message edited by: kavitha kandula ]
16 years ago
Hi,

I have developed a Struts project called "MyStrutsApp"

I have place it under
c:\tomcat5.5\webapps\MyStrutsApp\WEB-INF\src\MyActionForm.java

When i try to compile tha abpve file,
Iam getting the error as

Package "javac.Servlet.http.HttpServletRequest does not exist
Package org.apache.struts.action.Action does not exist.

I have set the classpath as follows.

SET CLASSPATH = %CLASSPATH%;.;C:\Tomcat5.5\common\lib\servlet-api.jar;C:\Tomcat 5.5\common\lib\jsp-api.jar
SET JAVA_HOME=C:\jdk1.5.0_12
SET PATH = C:\jdk1.5.0_12\bin;%PATH%

Can anyone suggest me what i need to do to compile "MyActionForm.java"

Thax in advance
16 years ago
Hi,

I have developed a Struts project called "MyStrutsApp"

I have place it under
c:\tomcat5.5\webapps\MyStrutsApp\WEB-INF\src\MyActionForm.java

When i try to compile tha abpve file,
Iam getting the error as

Package "javac.Servlet.http.HttpServletRequest does not exist
Package org.apache.struts.action.Action does not exist.

I have set the classpath as follows.

SET CLASSPATH = %CLASSPATH%;.;C:\Tomcat5.5\common\lib\servlet-api.jar;C:\Tomcat 5.5\common\lib\jsp-api.jar
SET JAVA_HOME=C:\jdk1.5.0_12
SET PATH = C:\jdk1.5.0_12\bin;%PATH%

Can anyone suggest me what i need to do to compile "MyActionForm.java"

Thax in advance
16 years ago