The BigBarber

Greenhorn
+ Follow
since Mar 30, 2004
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 The BigBarber

Hello

I am using the calendarPopup to popup a new window with the calendar. It is working fine in netscape 4 and also in IE 5. But in a particular page i am finding the Access Denied error message. The message comes when the associated popupwindow refreshes the page. Can anyone help me?
Have you added the ApplicationResources.properties file to the controller servlet in the web.xml file. as init-param
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
19 years ago
Dear Nerbo
It seems you are totaly new to Struts framework. If you are creating the bean inside the Action Class then there is no need of defining it again in the jsp. Also if you simply want to display it in the jsp page then simply send the username to the jsp, and in the jsp use request.getParameter("username") to access it and display it in the browser.
19 years ago
I have tried the same application by creating a jsp page one action class one form bean and another java bean as in your case to access the database and it is running absolutly fine. I cannot figure out why it cannot work out for you. OK. I m posting my code find out the problem urself.
LogonAction.java
****************
package ideas;
import javax.servlet.http.*;
import javax.servlet.*;
import org.apache.struts.action.*;
import javax.sql.*;
import java.sql.*;
public class LogonAction extends Action
{
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest req, HttpServletResponse res)
{
Logon l = (Logon)form;
String Uname = l.getUname();
String Passwd = l.getPasswd();
if(Uname.equals("ADMIN")){
if(Passwd.equals("admin")){
return mapping.findForward("Logon");
}
}
bean BEAN = new bean();
try{
BEAN.create(Uname);
}catch(Exception e){System.out.println(e);}
return mapping.findForward("LogonError");
}
}
Bean.java
*********
package ideas;
import java.sql.*;
import javax.sql.*;
import javax.naming.*;

public class bean {
public void create(String name) throws Exception{
Context ctx = new InitialContext(System.getProperties());
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/struts");
Connection con = ds.getConnection();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select max(IND) from struts_index");
rs.next();
int index = Integer.parseInt(rs.getString(1));
System.out.println("index::"+index);
stmt.executeUpdate("insert into struts_index values ("+ ++index +",'"+name+"')");
stmt.close();
con.close();
}
}
Struts-config.xml
*****************
A Part of my Struts-Config.xml Contains the following.
<!-- ========== Form Bean Definitions =================================== -->
<form-beans>
<form-bean name="Logon"
type="ideas.Logon"/>
</form-beans>
<!-- ========== Global Forward Definitions ============================== -->
<global-forwards>
<forward name="Blank"
path="/jsp/ideas/blank.jsp"
redirect="false"/>
<forward name="Logon"
path="/jsp/ideas/LogonSuccess.jsp"
redirect="false"/>
<forward name="Logout"
path="/jsp/ideas/LogoutSuccess.jsp"/>

<forward name="LogonError"
path="/jsp/ideas/LogonError.jsp"/>
<forward name="Login"
path="/login.jsp"/>

</global-forwards>
<!-- ========== Action Mapping Definitions ============================== -->
<action-mappings>
<action path="/Logon"
type="ideas.LogonAction"
name="Logon"
input="/jsp/ideas/Logon.jsp"
scope="session"/>

<action path="/Logout"
type="ideas.LogoutAction"
name="Logon"
scope="request"/>

</action-mappings>

[ April 22, 2004: Message edited by: The BigBarber ]
19 years ago
can you post your code then it can be corrected.
19 years ago
Why dont you try the new struts extension library named struts-layout. It is available at the following address:
http://struts.application-servers.com
19 years ago
Something must be wrong in your bean in which you are connecting to the database. Double check it.
Either you are not closing the connection after inserting the data into the data base so that the connection remain open. This may create identical rows in the table but will not insert a value twice. Try printing the intermediate steps either to the log or to the console and find out the problem.
[ April 22, 2004: Message edited by: The Big Barber SSSS ]
19 years ago
Hi,
Here is the log out put when i try using struts in iplanet6.0 SP1 server. Can anyone tell me the reason.
[22/Apr/2004:11:28:49] info ( 1744): JSP: JSP1x compiler threw exception
org.apache.jasper.compiler.CompileException: D:/iPlanet/User_Projects/Struts/jsp/login.jsp(2,0) Unable to open taglibrary /WEB-INF/struts-bean.tld : Parse Error in the tag library descriptor: External entity not found: "http://java.sun.com/dtd/web-app_2_2.dtd".
at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:707)
at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:110)
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:215)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1077)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1042)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:218)
at com.iplanet.server.http.servlet.NSServletEntity.load(NSServletEntity.java:252)
at com.iplanet.server.http.servlet.NSServletEntity.update(NSServletEntity.java:173)
at com.iplanet.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:410)

[22/Apr/2004:11:28:49] warning ( 1744): Internal error: Failed to get GenericServlet. (uri=/jsp/login.jsp,SCRIPT_NAME=/jsp/login.jsp)
Thank you.
[ April 22, 2004: Message edited by: The Big Barber SSSS ]
19 years ago
I'm finding this error after deploying from a war file in iWS 6.0 . The war contains some jsp pages, beans, servlets and also ejb classes. Can anyone tell me the reson. And help me to correct it. Thankyou.
[31/Mar/2004:11:23:59] info ( 1032): vs(https-Ashok)servlet 'jsp' class = 'org.apache.jasper.servlet.JspServlet' loaded in context = '/ideas'
[31/Mar/2004:11:23:59] info ( 1032): jsp: init
[31/Mar/2004:11:23:59] info ( 1032): jsp: init
[31/Mar/2004:11:23:59] failure ( 1032): Internal error: Unexpected error condition thrown (unknown exception,no description), stack: java.lang.NoClassDefFoundError: javax/security/auth/callback/CallbackHandler
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:115)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:131)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:660)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:241)
at javax.naming.InitialContext.init(InitialContext.java:217)
at javax.naming.InitialContext.<init>(InitialContext.java:193)
at ideas.util.ServerProperties.getContext(ServerProperties.java:48)
at ideas.beans.AdhocHandBean.<init>(AdhocHandBean.java:39)
at _jsps._jsp._AdhocHandoff_jsp._jspService(_AdhocHandoff_jsp.java:194)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:247)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.access$6(JspServlet.java:237)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:520)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:589)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:891)
at com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1064)
at com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:953)
19 years ago