Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!

Gaurav Pawar

Ranch Hand
+ Follow
since Sep 12, 2006
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 Gaurav Pawar

Hi all,
I need JSP code to identify an image using its time-stamp.

Something like:



I got this from one of the previous posts, I tried it but is not working. What could be wrong?

The reason why i need to identify the images using a timestamp is that for every client request my server is generating a different image each time as "myimage.png".

However, IE does not refresh and somehow shows the previously generated image. I want code that specifically identifies an image by its name and some other additional property.

Thank you.
Gaurav.
16 years ago
JSP
Yeah changing to .text worked.
Thanks a lot.
Hi all,

This is the javascript. Here "FY" and "TY" are the 'id' for a select-box which has years listed in it.







Please suggest what the problem could be.

Thank you.
Gaurav.
[ April 03, 2007: Message edited by: Gaurav Pawar ]
Hi,

I got the solution to this one. I had declared the 'Data Source Name' as User DSN. I then tried declaring it as a System DSN and it worked.

Thanks,
Gaurav
16 years ago
JSP
could you please write a sample example for the img tag with the exact syntax?

Thanks
Gaurav
Hey Thanks, But i have done that already.. .. but that solution is temporary since i land up creating a large number of image files on the server.

Any other more generic solution to this?

Thanks
Also if you have any code like a javascript do let me know.

Thanks a lot.
Gaurav.
HI all,
I have a jsp that takes in a few parameters, passes them to server, the server generates an image and this image is displayed on another page image.jsp.

With every new request there is a new image generated and then displayed on the image.jsp...

This works fine with firefox. However with IE i am having a difficulty where in it does not show the updated image. It shows me the prior image.

Please help, this is kind of urgent.


Thanks.
Gaurav
Hi all,
I have an application deployed on tomcat. The application is supposed to generate an Image file (myImage.png).

I want to display this image on a JSP page. When i run the application the image file is not generated in any of tomcat folder hierarchy.

The way i have specified the output path for the image is



How do i specify path so that this image is output in my tomcat/webapps/app folder?

Thank you in advance.
Regards,
Gaurav
16 years ago
Hi,
Well my code for accessing the database is in a java class called Starter.java which has a function




and this is what getData() does.


This class is in webapps/MyApp/WEB-INF/classes/core

In my JSP i have the following code.

<%@page import="core.Starter"%>
<%

Starter StMap = new Starter();
StMap.InitializeMap();

%>

The Error: org.apache.jasper.JasperException: Array index out of range: 0


The problem is this works fine as a standalone application.. but after deployment

I have put the database in webapps/MyApp

When i run this in my browser as http://localhost:8080/MyApp/Map.jsp
it gives the error


org.apache.jasper.JasperException: Array index out of range: 0
[ March 18, 2007: Message edited by: Gaurav Pawar ]
16 years ago
JSP
Hi all,
I have a sample Java Program that manipulates a MS Access Database. I have now written JSP code to perform the same functions (insert/ delete.) on the database.

I have my class files under WEB-INF/classes and the database in webapps/MyApp/myDB.mdb

Could you please help me with the following.
1. Is the database placed in the right path.
2. Do i have to place the driver in the WEB-INF/lib? if so which drivers. I did search a lot but could not find a good reference

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String dataSourceName = strDSN;
String dbURL = "jdbc:odbc:" + dataSourceName;
Connection con = DriverManager.getConnection(dbURL, "","");
Statement s = con.createStatement();
s.execute(strQuery);

This is how the code in my java class looks like. This class is called from the JSP.

Can anyone please give me guidelines/ sample example on a JSP accessing a (ms acess) database deployed in Tomcat?

Thanks.
Gaurav
16 years ago
JSP


Hi all,
The solution to this is,
Place the file in classes under webapps (this is what my requirement was)
and then use the command

InputStream in = myLALoginBean.class.getResourceAsStream("/Records.xml");
---- followed by

DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Document domDoc = docBuilder.parse(in);

Thanks,
Gaurav Pawar
17 years ago
Hey Thanks for the reply.
Actually i have just 3 classes.
1. LoginAction.class
2. LoginForm.class
3. LoginBean.class
and on xml file -- records.xml

Login Bean reads the "records.xml" file, checks node values and returns result to the LoginForm.

I have all these placed in WEB-INF/classes.

Still do not get it right...

Gaurav

17 years ago
The bean(model) in my struts application uses the following statements

...
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Document domDoc = docBuilder.parse("Records.xml");
...


and further returns the values in XML file.

THis executes fine as a standalone java application.
After deploying my app in Tomcat while debugging the program stops at
'Document domDoc = docBuilder.parse("Records.xml");'

I have placed Records.xml in the classes folder under WEB-INF.

Any suggestions how I should specify tomcat specific path??

Thanks,
Gaurav.
17 years ago
Hi all,
The situation i am in is a struts application running on a Linux box(Tomcat) and the business logic for it (a C++ dll) is on the Windows machine.

I am using RMI for communication between the two remote hosts (The linux and the windows machine). This serves all the requests serially. One after another since there is just one instance of the object in the registry.

I want to implement RMI like functionality for multiple clients so that for every incoming request a new bean is instantiated and the requests get served simultaneously maintaining a session for each client.

Is this possible??
if so how.

Regards,
Gaurav
17 years ago