i tried to add struts-taglib-1.3.8 from location D:\Program Files\Genuitec\MyEclipse 7.5\configuration\org.ecli
'click here' giving error message like tags-html
as in screenshot.
Main Topics
Browse All TopicsHi,
I am trying to run a struts 1.1 login example in RAD 7.0 within websphere 6.1 server. My code looks as follows. It has simple form, action, three simple jsps and a validation. When i try to run it giving error saying 'unable to locate tag library tags-html as in attachment
ApplicationResources.prope
# Resources for parameter 'com.myeclipseide.example.
# Project StrutsLoginExample
error.name.required=User Name Required
error.password.required=Pa
error.name.myeclipse=Pleas
error.password.myeclipse=P
index.jsp looks like
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MyEclipse Struts Login Example</title>
</head>
<body>
<h1>
MyEclipse Struts Login Example Project
</h1>
<div
style="padding-left: 5px; padding-top: 10px; padding-bottom: 10px; background: #f0f0f0">
<b><a href="userLogin.jsp">Click
example</b>
</div>
<h2>
Description
</h2>
A tutorial showing how to develop a simple login-style Struts application.
<br>
<h2>
Requirements
</h2>
MyEclipse 6.0 or a previous version of MyEclipse with an application
server that the project can be deployed to and run.
<h2>
How to Run
</h2>
You can right-click on this project and go to Debug As or Run As then select
"MyEclipse Server Application". MyEclipse 6.0 and later will automatically deploy
the application to the MyEclipse Tomcat Server, then start it up and open
a browser window for you to the index.jsp page.
<br>
<h2>
Related Links
</h2>
<ul>
<li>
MyEclipse Web Project Tutorial -
<a href="http://www.myeclipse
</li>
<li>
MyEclipse Application Server Tutorial -
<a href="http://www.myeclipse
</li>
<li>
MyEclipse Struts 1.x Tutorial -
<a href="http://www.myeclipse
</li>
</ul>
<h2>
Feedback
</h2>
We hope you found this example project helpful. If you ran into any
problems
<br>
while working with the example project, please feel free to post to
our Example
<br>
Project Forum (
<a href="http://www.myeclipse
and
<br>
let us know. Also if you had any suggestions for improvements, noticed
something
<br>
wrong or just wanted to ask questions we encourage you to post and let
us know!
</body>
</html>
userLogin.jsp looks like
<%@ page language="java" pageEncoding="ISO-8859-1"%
<%@ taglib uri="http://struts.apache.
<%@ taglib uri="http://struts.apache.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
<html:base />
<title>JSP for UserLoginForm form</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control"
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<html:form action="/userLogin">
<table border="1" cellpadding="4">
<tbody>
<tr>
<td align="right">
User Name:
</td>
<td>
<html:text property="userName" />
</td>
<td>
<html:errors property="userName" />
</td>
</tr>
<tr>
<td align="right">
Password:
</td>
<td>
<html:password property="password" />
</td>
<td>
<html:errors property="password" />
</td>
</tr>
<tr>
<td>
</td>
<td>
<html:submit />
<html:cancel />
</td>
</tr>
</tbody>
</table>
</html:form>
</body>
</html:html>
userLoginSuccess looks like
<%@ page language="java" pageEncoding="ISO-8859-1"%
<%@ taglib uri="http://struts.apache.
<%@ taglib uri="http://struts.apache.
<%@ taglib uri="http://struts.apache.
<%@ taglib uri="http://struts.apache.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html>
<head>
<title>My Struts 'userLoginSuccess.jsp' ending page</title>
</head>
<body>
Hello <bean:write name="userName" scope="request" />, you successfully logged in!
</body>
</html:html>
struts-config looks like
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/
<struts-config>
<form-beans>
<form-bean name="userLoginForm"
type="com.myeclipseide.exa
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings>
<action attribute="userLoginForm" input="/userLogin.jsp"
name="userLoginForm" path="/userLogin" scope="request"
validate="true"
type="com.myeclipseide.exa
<forward name="success" path="/userLoginSuccess.js
<forward name="failure" path="/userLogin.jsp" />
</action>
</action-mappings>
<message-resources
parameter="com.myeclipseid
</struts-config>
web.xml looks like
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com
xmlns:xsi="http://www.w3.o
xsi:schemaLocation="http:/
<servlet>
<servlet-name>action</serv
<servlet-class>
org.apache.struts.action.A
</servlet-class>
<init-param>
<param-name>config</param-
<param-value>/WEB-INF/stru
</init-param>
<init-param>
<param-name>debug</param-n
<param-value>3</param-valu
</init-param>
<init-param>
<param-name>detail</param-
<param-value>3</param-valu
</init-param>
<load-on-startup>0</load-o
</servlet>
<servlet-mapping>
<servlet-name>action</serv
<url-pattern>*.do</url-pat
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</w
</welcome-file-list>
</web-app>
UserLoginAction looks like
package com.myeclipseide.examples.
import javax.servlet.http.HttpSer
import javax.servlet.http.HttpSer
import org.apache.struts.action.A
import org.apache.struts.action.A
import org.apache.struts.action.A
import org.apache.struts.action.A
import com.myeclipseide.examples.
public class UserLoginAction extends Action {
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
UserLoginForm userLoginForm = (UserLoginForm) form;
if (userLoginForm.getUserName
&& userLoginForm.getPassword(
request.setAttribute("user
return mapping.findForward("succe
}
return mapping.findForward("failu
}
}
userLoginForm looks like
package com.myeclipseide.examples.
import javax.servlet.http.HttpSer
import org.apache.struts.action.A
import org.apache.struts.action.A
import org.apache.struts.action.A
import org.apache.struts.action.A
public class UserLoginForm extends ActionForm {
private static final long serialVersionUID = 1L;
private String password;
private String userName;
@Override
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (getUserName() == null || getUserName().length() < 1) {
errors.add("userName", new ActionMessage("error.name.
} else if (!getUserName().equalsIgno
errors.add("userName", new ActionMessage("error.name.
}
if (getPassword() == null || getPassword().length() < 1) {
errors
.add("password", new ActionMessage(
"error.password.required")
} else if (!getPassword().equalsIgno
errors.add("password",
new ActionMessage("error.passw
}
return errors;
}
@Override
public void reset(ActionMapping mapping, HttpServletRequest request) {
password = null;
userName = null;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
}
Any ideas, suggestions, sample code, links highly appreciated. Thanks in advance.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
i tried to add struts-taglib-1.3.8 from location D:\Program Files\Genuitec\MyEclipse 7.5\configuration\org.ecli
'click here' giving error message like tags-html
as in screenshot.
I tried to add the taglib
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com
<display-name>
StrutsLogin</display-name>
<servlet>
<servlet-name>action</servlet
<servlet-class>
org.apache.struts.action.A
<init-param>
<param-name>config</param-nam
<param-value>/WEB-INF/struts
</init-param>
<init-param>
<param-name>debug</param-name
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-nam
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-n
<param-value>true</param-valu
</init-param>
<load-on-startup>2</load-on-s
</servlet>
<servlet-mapping>
<servlet-name>action</servlet
<url-pattern>*.do</url-patter
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</wel
<welcome-file>index.htm</welc
<welcome-file>index.jsp</welc
<welcome-file>default.html</w
<welcome-file>default.htm</we
<welcome-file>default.jsp</we
</welcome-file-list>
<taglib>
<taglib-uri>testTags</taglib-
<taglib-location>/WEB-INF/tl
</taglib>
</web-app>
as given in above link and some syntax errors coming in web.xml. Please advise on how i can resolve it.
Business Accounts
Answer for Membership
by: sanjoozPosted on 2009-08-26 at 18:37:12ID: 25193881
Take a look here
e.com/Prog ramming/La nguages/Ja va/ Q_21784 614.html
http://www.experts-exchang