Amarjyoti Das

Greenhorn
+ Follow
since Mar 18, 2002
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 Amarjyoti Das

Hi,
The struts documentation says that "The property name of this image tag. The parameter names for the request will appear as "property.x" and "property.y", the x and y representing the coordinates of the mouse click for the image. A way of retrieving these values through a form bean is to define getX(), getY(), setX(), and setY() methods, and specify your property as a blank string (property="")."
My JSP page uses the image tag in the following manner
<html:image src='<%= map.getMap() %>' property=""/>
In the MapForm page I use the following
public class MapForm extends ActionForm {

private String x;
private String y;
public String getX() {
return x;
}

public String getY() {
return y;
}
public void setX(String string) {
x = string;
}
public void setY(String string) {
y = string;
}
}

The MapAction form has the following code
if (form != null) {
x = ((MapForm)form).getX();
y = ((MapForm)form).getY();
logger.info("The coords are :: " + x + " " + y);
}
My image displays OK. But when I click on the image I get the following error message. I am using Tomcat 4.1.24.
java.lang.NullPointerException
at com.psgs.action.MapAction.execute(MapAction.java:61)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
Please help.
20 years ago
Do not know why the Graemlins appeared in my last question. Those should be <logic resent> & <bean efine>
Thanks/Amar
20 years ago
Hi,
When I try to run the following JSP page in Tomcat 4.1.24, I receive the following error
Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] C:\ApacheGroup\Tomcat4.1\webapps\struts-ims\work\org\apache\jsp\mappage_jsp.java:86: cannot resolve symbol
[javac] symbol : variable mapurl
[javac] location: class org.apache.jsp.mappage_jsp
[javac] out.println (mapurl);
[javac] ^
[javac] 1 error


If I change the logic and bean tag portion with the following code my page work fine. Any idea what am I doing wrong?

Thank you
20 years ago
Hi,
When I hit the submit button in the following page, will another mybean be created with session scope? If so, how can I overcome that?
Code for test.jsp page
======================

Thank you,
Amar
20 years ago
JSP
Hi,
Where does session information get stored? For example, please consider the following statement in a JSP page.
<%= session.getId() %>
Where the ID, max inactive interval or other session related information are stored? Is it on a client side cookie?
Thank you,
Amar Das
20 years ago
JSP
Hi,
I am trying to use a datasource with JSTL <sql> tag. I am using Tomcat 4.1 with DBCP and Oracle. The code is shown below. I am receiving "datasource is null" message.
Thank you,
Amar Das
<%@ page import="javax.naming.*,javax.sql.*,java.sql.*" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%
try {
Context ctx = new InitialContext();
if(ctx == null )
throw new Exception("Boom - No Context");
Context envContext = (Context)ctx.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/dqs_maoracle");
%>
<sql:query var="deejays" dataSource="${ds}">
select TABLE_NAME from USER_TABLES
</sql:query>
20 years ago
JSP
Hi,
Anybody playing with dbcp from apache? I compined ManualPoolingDriverExample.java. Before compiling, I put commons-dbcp.jar, commons-pool.jar and commons-collections.jar under \lib\ext directory of JDK (1.4). I also renamed class12.zip ( oracle jdbc driver) to oracle-jdbc.jar. The code comiples fine. But when I try to run it using the following command it fails to create a database connection. Please help.
Thank you,
C:\java\classes>java ManualPoolingDriverExample "jdbc racle:thin:smms/password@myserver:1521:smms" "
SELECT * FROM DUAL"
Setting up driver.
Done.
Creating connection.
Exception in thread "main" org.apache.commons.dbcp.DbcpException: java.sql.SQLException: No suitable driver
at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFa
ctory.java:101)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:184)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown Source)
at org.apache.commons.dbcp.PoolingDriver.connect(PoolingDriver.java:146)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:199)
at ManualPoolingDriverExample.main(ManualPoolingDriverExample.java:153)
Hi,
Anybody trying the example in the book in the subject line by Pravin Tulachan. I am trying the example in chapter 6. After depoying the Session bean, when I try http://localhost:8000/ScheduleRootContext/SearchCourse.htm, I receive the following error. Please help.
Thank you.
javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/ScheduleRef
at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:578)
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:90)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at SearchScheduleServlet.init(SearchScheduleServlet.java:53)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:852)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:615)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:368)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)
java.lang.NullPointerException
at SearchScheduleServlet.defaultAction(SearchScheduleServlet.java:125)
at SearchScheduleServlet.doGet(SearchScheduleServlet.java:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:197)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:172)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:368)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)
== Servlet - dispatching to JSP
Is it possible to show a progress bar while a JSP page is loading. Will appreciate some pointers about how to do that.
Thank you,
-- amar
21 years ago
JSP
I am trying to do create a simple String Buffer and my jsp page is failing. Here is what I am trying to do.
StringBuffer sb = new StringBuffer();
sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?> ;
When I do <%= sb.toString() %> it returns nothing. If I do \< then I get invalid escape character error message. How can I fix the situation. I need to create an XML page from my JSP page.
Thank you
-- amar
21 years ago
JSP
Hello,
I downloaded and installed Microsoft's JDBC driver. But I could not find any documentation about how to use it. Could you give me some direction. Here is what I am using
<%@ page isErrorPage="false"%>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<!-- HTML COMMENTS -->
<html>
<body>
<!-- declare the parameters passed from the html page-->
<%
try {
// Step 1: Load the JDBC driver.
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
// Step 2: Establish the connection to the database.
String url = "jdbc:microsoft:sqlserver://servername:1433;DatabaseName=sde;SelectMethod=cursor";
Connection conn = DriverManager.getConnection(url,"user","password");
if (conn == null) {
out.println ("Connection successfully created");
} else {
out.println ("Connection could not be created");
}

conn = null;
} catch (Exception e) {
out.println ( "Some Exception occured" );
} //end SQLException
%>
</body>
</html>
When I run the page in my browser I get "Some Exception Occured.
On another note, I have 3 .jar files when I installed the JDBC driver - mssqlserver.jar, mbase.jar and msutil.jar. I could put the complete pathname of the 1st jar file in my classpath (Windows 2000, System->Advanced tab). But my classpath have already become so long that I could not fit the 2 other .jar files. Any suggestions?
Thank you
I just downloaded and installed JAI for Windows JDK and the Samples files. Then I tried to run JAIDemo sample. But I am receiving the following error. Could anybody point out what I am doing wrong.
Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/jai/PlanarImage
at JAIDemo.<init>(JAIDemo.java:451)
at JAIDemo.main(JAIDemo.java:608)
Thanks you
21 years ago
How many different ways you can save a Java2D graphics. I know that you can save them as an image. In that case, is it possible to get the graphics back from the image later. Also, is there other ways to store java2D graphics. Sample code for this purpose will be much appreciated.
Thanks
21 years ago
Could anybody provide me with suggestions for good game programming book in Java?
Thanks
21 years ago
Seamlessly : You hold your mouse button without releasing it and the graphic is getting bigger and bigger.
I am trying to zoom into a 2D graphic (rectangle for example without increasing the line size as I zoom in.
Thanks, amar
21 years ago