Madhan Kumar

Greenhorn
+ Follow
since Apr 03, 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 Madhan Kumar

Hi
I have a servlet(trimrec.java) file which has a javascript button.
When i click the button, i want some attributes that
are set to be passed to a JSP file(/search.jsp).

ServletContext sc = this.getServletContext();
RequestDispatcher rd = sc.getRequestDispatcher("/search.jsp");
if (rd !=null) {
// Pass control to the JSP.
try {
rd.forward(request, response);
} catch (Exception e) {
sc.log("Problem invoking JSP.", e);
}
}

This is inside a get method of trimrec.java servlet.
What happens is that my tomcat gets automatically shutdown
when it processes this code...
Please do reply me what to do..This happens because i have codings
followed after the above in the servlet file...
Regards
Madhan
19 years ago
Hi
I want to use a set of Strings inside JSP file.
I have a file called trimtest1.java
import trimIBM.*;
import com.ibm.bridge2java.*;
import java.util.*;
public class trimtest1
{
public static void main(String args[])
{
try
{
int intEachLoc;
com.ibm.bridge2java.OleEnvironment.Initialize();
IDatabase db = (IDatabase) new Database();
ILocations loc = (ILocations) new Locations();
db.set_Id("11");
loc = db.MakeLocations();
loc.SelectAll();
for(intEachLoc=0;intEachLoc<loc.get_Count();intEachLoc++)
{

System.out.println(loc.Item (intEachLoc).get_FormattedName());
}
}
}

This file outputs a set of Strings...
I want these strings in my JSP file...
Please do reply me in detail...
Expecting ur reply
Regards
Madhan
19 years ago
JSP
Hi
I have created a jsp file
and have stored in c:\tomcat\jakarta\webapps\trim\trimev.jsp
when i call it from http://localhost:8080/trimtest/trimev.jsp
I get the following error:
org.apache.jasper.JasperException: /trimev.jsp(3,0) Page directive has invalid attribute: contenType
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236)
org.apache.jasper.compiler.JspUtil.checkAttributes(JspUtil.java:348)
org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:144)
org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:578)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2180)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2230)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2236)
org.apache.jasper.compiler.Node$Root.accept(Node.java:485)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2180)
org.apache.jasper.compiler.Validator.validate(Validator.java:1481)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:247)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

please do reply me
Regards
Madhan
20 years ago
Hi
I have created a jsp file
and have stored in c:\tomcat\jakarta\webapps\trim\trimev.jsp
when i call it from http://localhost:8080/trimtest/trimev.jsp
I get the following error:
org.apache.jasper.JasperException: /trimev.jsp(3,0) Page directive has invalid attribute: contenType
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236)
org.apache.jasper.compiler.JspUtil.checkAttributes(JspUtil.java:348)
org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:144)
org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:578)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2180)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2230)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2236)
org.apache.jasper.compiler.Node$Root.accept(Node.java:485)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2180)
org.apache.jasper.compiler.Validator.validate(Validator.java:1481)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:247)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

please do reply me
Regards
Madhan
20 years ago
JSP
Hi
I get the error :"HTTP Status 405 - HTTP method POST is not supported by this URL" when i try to run my servlet using POST method.
Iam using the jar files
C:\Tomcat\jakarta-tomcat-5.0.19\common\lib\servlet-api.jar
C:\Tomcat\jakarta-tomcat-5.0.19\common\lib\jsp-api.jar
and have also uncommented the corresponding codings in xml
file..
Please do reply me
Regards
Madhan
20 years ago
Hi
Iam new to JSP. I want to create
dynamic application with list boxes
and buttons.
Iam using tomcat 5.0.19. I want
to know how to create and use JSP
along with servlet..
Reagards
Madhan
20 years ago
Hi
I have a big problem.
I got t expain to u in detail.I have installed
tomcat 5.0.19 in windows xp.
I have set the classpath as follows:
C:\Documents and Settings\madhan\My Documents\servlets
C:\Tomcat\jakarta-tomcat-5.0.19\common\lib\servlet-api.jar
C:\Tomcat\jakarta-tomcat-5.0.19\common\lib\jsp-api.jar
catalina_home=c:\tomcat\jakarta-tomcat
path = c:\j2sdk1.4.2_04\bin;c:\tomcat\jakarta-tomcat\bin;%path%
Java_home=c:\j2sdk1.4.2_04
Iam able to run a simple servlet in "http://localhost:8080/servlet/Hello"
I have used "bridge2java" software to convert a
Visual Basic dll(trimSDK.dll) to a java dll
(bridge2java.dll)which contains the converted
java classes(COM objects).
Now i have these java classes(COM objects)
in c:\IBM\bridge2java
I can run a code using some classes
from it in c:\IBM\bridge2java
and it works fine.
c:\IBM\bridge2java\javac trim.java
c:\IBM\bridge2java\java trim
But when i include it in servlet it doesnt
run and i get an error like this:
Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Cannot allocate servlet instance for path /servlet/trim
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:435)
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

root cause
java.lang.NoClassDefFoundError: trimIBM/IDatabase
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)
java.lang.Class.getConstructor0(Class.java:1922)
java.lang.Class.newInstance0(Class.java:278)
java.lang.Class.newInstance(Class.java:261)
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:416)
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
The code i used is:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.swing.*;
import trimIBM.*;
/** Simple servlet used to test server.
* <P>
* Taken from Core Servlets and JavaServer Pages 2nd Edition
* from Prentice Hall and Sun Microsystems Press,
* http://www.coreservlets.com/.
* © 2003 Marty Hall; may be freely used or adapted.
*/
public class trim extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
com.ibm.bridge2java.OleEnvironment.Initialize();
IDatabase d = (IDatabase) new Database();
d.set_Id("11");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String docType =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
"Transitional//EN\">\n";
out.println(docType +
"<HTML>\n" +
"<HEAD><TITLE>"+d.get_Name()+"</TITLE></HEAD>\n" +
"<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1>"+d.get_Name()+"</H1>\n" +
"</BODY></HTML>");
}
}

please do reply me with the solution of how to
use COM objects in tom cat servlet...
Regards
Madhan
20 years ago
Thank u. It works. Now i have a big problem.
I got t expain to u in detail.I have installed
tomcat 5.0.19 in windows xp.
I have set the classpath as follows:
C:\Documents and Settings\madhan\My Documents\servlets
C:\Tomcat\jakarta-tomcat-5.0.19\common\lib\servlet-api.jar
C:\Tomcat\jakarta-tomcat-5.0.19\common\lib\jsp-api.jar
catalina_home=c:\tomcat\jakarta-tomcat
path = c:\j2sdk1.4.2_04\bin;c:\tomcat\jakarta-tomcat\bin;%path%
Java_home=c:\j2sdk1.4.2_04
Iam able to run a simple servlet in "http://localhost:8080/servlet/Hello"
I have used "bridge2java" software to convert a
Visual Basic dll(trimSDK.dll) to a java dll
(bridge2java.dll)which contains the converted
java classes(COM objects).
Now i have these java classes(COM objects)
in c:\IBM\bridge2java
I can run a code using some classes
from it in c:\IBM\bridge2java
and it works fine.
c:\IBM\bridge2java\javac trim.java
c:\IBM\bridge2java\java trim
But when i include it in servlet it doesnt
run and i get an error like this:
Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Cannot allocate servlet instance for path /servlet/trim
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:435)
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

root cause
java.lang.NoClassDefFoundError: trimIBM/IDatabase
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)
java.lang.Class.getConstructor0(Class.java:1922)
java.lang.Class.newInstance0(Class.java:278)
java.lang.Class.newInstance(Class.java:261)
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:416)
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
The code i used is:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.swing.*;
import trimIBM.*;
/** Simple servlet used to test server.
* <P>
* Taken from Core Servlets and JavaServer Pages 2nd Edition
* from Prentice Hall and Sun Microsystems Press,
* http://www.coreservlets.com/.
* © 2003 Marty Hall; may be freely used or adapted.
*/
public class trim extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
com.ibm.bridge2java.OleEnvironment.Initialize();
IDatabase d = (IDatabase) new Database();
d.set_Id("11");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String docType =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
"Transitional//EN\">\n";
out.println(docType +
"<HTML>\n" +
"<HEAD><TITLE>"+d.get_Name()+"</TITLE></HEAD>\n" +
"<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1>"+d.get_Name()+"</H1>\n" +
"</BODY></HTML>");
}
}

please do reply me with the solution of how to
use COM objects in tom cat servlet...
Regards
Madhan
20 years ago
Hi
I have installed apache tomcat 5.0.19 in
windows XP.Iam able to start and run servlet
code in my machine.
http://1.0.0.127/servlet/Hello
But what should i do to run the same
code in the client systems present.
I want to run the same code from my
other client machines...Please do help
me..Should i have to just give the same
"http://1.0.0.127/servlet/Hello" in my
client machine..
It is urgent!!!
Regards
Madhan
20 years ago