Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-03-2008, 03:03 AM
Member
 
Join Date: Nov 2007
Posts: 49
sireesha is on a distinguished road
Problem with my first Struts program....please help me
Hi Everyone,
I just started learning Struts programing.But got an error in my first program.From 2 days I am working on that...and i tried different solutions from different sites...but i couldn't find solution.I got this code from a book.I am using NetBeans6.0.
I wrote the following files
Registration.jsp,
RegistrationAction.java,
RegistrationForm.java,
Success.html,
Failure.html,
web.xml,
struts-config.xml,

I am getting error in my Registration.jsp file.
that error is..
File"/WEB_INF/struts-form.tld"not found

Here is my .jsp file
Code:
<%@ page language="java" %> <%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %> <form:form action="Registration.do"> UserName:<form:text property="username"/><br> enter password:<form:password property="password1"/><br> re-enter password:<form:password property="password2"/><br> <form:submit value="Register"/> </form:form>
My web.xml file is

Code:
<?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>application</param-name> <param-value>com.action.ApplicationResources</param-value> </init-param> <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> <!--Struts tag lib discriptions--> <taglib> <taglib-uri>/WEB-INF/struts-form.tld</taglib-uri> <taglib-location>/WEB-INF/struts-form.tld</taglib-location> </taglib> </web-app>
Here is my struts-config.xml file

Code:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd"> <struts-config> <form-beans> <form-bean name="RegistrationForm" type="application.RegistrationForm"/> </form-beans> <action-mappings> <action path="/Registration" name="RegistrationForm" type="application.RegistrationAction"> <forward name="success" path="/Success.html" /> <forward name="failure" path="/Failure.html" /> </action> </action-mappings> </struts-config>
My preparation was stopped because of problem.Please help me.
Thanks in advance.
sireesha.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-03-2008, 02:18 PM
Member
 
Join Date: Apr 2008
Location: hyderabad
Posts: 11
bhaskary is on a distinguished road
Send a message via Skype™ to bhaskary
just comment out the struts tag lib in web.xml..
not specifies tag libs in web.xml because if u are creating new project and add struts capabilities all tld files and all supporting configuration files no need to specifies
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-03-2008, 07:43 PM
Member
 
Join Date: Nov 2007
Posts: 49
sireesha is on a distinguished road
Thanks,
I tried it but it didn't work for me.I am getting error again.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-04-2008, 07:22 AM
Member
 
Join Date: Apr 2008
Posts: 1
raj999 is on a distinguished road
go for <html:form> instead of <form:form
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 04-04-2008, 07:33 AM
Member
 
Join Date: Apr 2008
Posts: 3
raghujapala@gmail.com is on a distinguished road
Quote:
Originally Posted by sireesha View Post
Hi Everyone,
I just started learning Struts programing.But got an error in my first program.From 2 days I am working on that...and i tried different solutions from different sites...but i couldn't find solution.I got this code from a book.I am using NetBeans6.0.
I wrote the following files
Registration.jsp,
RegistrationAction.java,
RegistrationForm.java,
Success.html,
Failure.html,
web.xml,
struts-config.xml,

I am getting error in my Registration.jsp file.
that error is..
File"/WEB_INF/struts-form.tld"not found

Here is my .jsp file
Code:
<%@ page language="java" %> <%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %> <form:form action="Registration.do"> UserName:<form:text property="username"/><br> enter password:<form:password property="password1"/><br> re-enter password:<form:password property="password2"/><br> <form:submit value="Register"/> </form:form>
My web.xml file is

Code:
<?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>application</param-name> <param-value>com.action.ApplicationResources</param-value> </init-param> <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> <!--Struts tag lib discriptions--> <taglib> <taglib-uri>/WEB-INF/struts-form.tld</taglib-uri> <taglib-location>/WEB-INF/struts-form.tld</taglib-location> </taglib> </web-app>
Here is my struts-config.xml file

Code:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd"> <struts-config> <form-beans> <form-bean name="RegistrationForm" type="application.RegistrationForm"/> </form-beans> <action-mappings> <action path="/Registration" name="RegistrationForm" type="application.RegistrationAction"> <forward name="success" path="/Success.html" /> <forward name="failure" path="/Failure.html" /> </action> </action-mappings> </struts-config>
My preparation was stopped because of problem.Please help me.
Thanks in advance.
sireesha.
hi, i hadbeen suffued too many problems like what u expline, thing is that netbeans id doen't implementing properly exceptionhandling meachnisam
solution is as possiblee as just change ur id ,just try it agin
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
in struts reset was problem sureshBabu Web Frameworks 1 05-07-2008 04:26 PM
Problem with Struts Menu sdp Advanced Java 3 08-10-2007 08:54 PM
Problem with my program HelloWorld trill New To Java 1 08-05-2007 06:32 PM
getting problem in compiling java program? sathish04021984 New To Java 3 07-30-2007 10:26 AM
Struts problem ziniestro Web Frameworks 2 05-10-2007 06:41 PM


All times are GMT +3. The time now is 09:14 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org