lohith micheal

Greenhorn
+ Follow
since Jan 07, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by lohith micheal

Hi guys,
i am making an application in which i want to send a mail from my Application
to any one in the world.
please help me in solving this?
try to explain me in Steps or get me few sites so that i can go through it?

Regards
Lohith M.K.
16 years ago
HI ,
there might be a problem in your TLDs.
so try to take the latest TLDs.from Struts blank if you have.
and then place it in side the WEB-INF.
then it might work i think so.
16 years ago
Hi,
These are called as getters and setters in your application.
for example if your filling a form which has to got to the database after submitting the ok button while filling your form what ever you would be filled all the values would be stored in this.
an din your action class these values would be called and gets copied to the action class form and then goes to dao class.
basically they are called as getters and setters for your application.
16 years ago
Hi Kavitha,
i have many softcopies which are very good.
if you can give your email id i can forward those copies to you.
Regards
Lohith M.k
16 years ago
hi,
as for as i know even i was facing the same problem ,
there was a problem in my src i.e destination of .class files was in the wrong path.
so i was getting that type of error. i have not worked on tomcat.
you do one thing check where your .class files are there.are they inside the web-inf or outside the web-inf.
if it is outside then put the .class files inside the web-inf.
then compile it and run it.s
16 years ago
when ever you build your application your resource properties get destroyed. so what you need to do is you need to place the application resource properties once again in class folder which is inside the web-inf.
then 101% it will work.
16 years ago
i think there might be a problem in .class files.
just check the src destination folder.
i was also facing the same problem there was a problem in .class files.
hope this information might help you.
i was working on eclipse.
16 years ago
HI,
if you have struts blank.war with you.
you can use the same tlds.
there is no problem with those tlds.
16 years ago
HI,
you can check the orielly matering in jakarta struts.
in that book they have given good example.
thanks,
Lohith M.K
16 years ago
Is this your jsp page.
you have not mentioned the tlds in your jsp page.
like
<%@ 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"%>
16 years ago

Originally posted by lohith mk:
Hi, i am getting an error when i am accessing the jsp page
the error is Cannot find bean: "org.apache.struts.taglib.html.BEAN"
i am sending the Jsp page ,struts-config.xml, and action class.
please help me in solving this.
The jsp page:

<%@ 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"%>
<html:html>
<head>

<title>Welcome</title>
</head>

<script type="text/javascript">


function validate_form ()
{
valid = true;
if ( document[0].username.value == "" )
{
alert ( "Please input username." );
valid = false;
}
if ( document[0].password.value == "" )
{
alert ( "Please input password." );
valid = false;
}
return valid;
}

</script>
<form action="/test">


<h1><marquee>Welcome to mphasis page</marquee></h1>

Current time:
<%=new java.util.Date()%>

<table width="400" border="1">
<tr>

<td align="left">Username:</td>
<td align="right"><html:text property="username"></html:text></td>
</tr>
<tr>
<td align="left">Password:</td>
<td align="right"><html:text property="password"></html:text></td>
</tr>
<tr>
<td align="left"><html:submit>submit</html:submit></td>
</tr>
</table>

</form>
</html:html>


Action class:

package com.mphasis.action;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;


import com.mphasis.form.LeaveForm;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class LeaveAction extends Action
{
public ActionForward execute
(
ActionMapping mapping, ActionForm form,
HttpServletRequest req, HttpServletResponse res
)
throws Exception
{
System.out.println("inside the action class");
LeaveForm form1 = (LeaveForm)form;

return mapping.findForward("sucess");
}

}

Action form :
package com.mphasis.form;

import org.apache.struts.action.ActionForm;

public class LeaveForm extends ActionForm
{
private String username;
private String password;
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;
}

}

Struts-config.xml:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "C:\struts-config_1_2.dtd">

<struts-config>
<form-beans>
<form-bean
name ="Forms"
type="com.mphasis.form.LeaveForm"/>
</form-beans>

<action-mappings>
<action path="/test"
type="com.mphasis.action.LeaveAction"
name="Forms"
input="/Login1.jsp"
scope="request">
<forward name="sucess" path="/sucess.jsp"/>


</action>
</action-mappings>


</struts-config>

WEB.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>

<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>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>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>


<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/Login1.jsp</welcome-file>
</welcome-file-list>

<!-- Struts Tag Library Descriptors -->
<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>

</web-app>

Please help in solving this.



Thanks guys ,
i have solved the problem.
there was a mistake in .class files.
16 years ago