Sandeep Deshmukh

Greenhorn
+ Follow
since Dec 06, 2004
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Sandeep Deshmukh

Hello Guys,

I have worked on a module in my project within which i have passed module id's to diffrentiate between different calls from within the module . The ids are of String type.
The same module is to be reused as it is almost same as above . I have used module ids again to toggle between the 2 modules. But the procesing has become slow . Is it because of the number of String comparisons. my friend suggested to use switch-case by assigning module id unique integers in begining of method calls and use the switch case for them in subsequent comparisons. Will this be faster than string comaparison?

Sandeep Deshmukh
12 years ago
Hi nidhi

To use a bean include that bean package in your classes directory, import that package into servlet and you can use the bean classes as you do in jsp.

Sandeep
13 years ago
Hi guys

I would like to add that my local servlet for testing purpose has following code:

public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");

PrintWriter out = response.getWriter();
out.println(..........
}

Sandeep
13 years ago
hi guys

Unfortunately i dont have access to the servlet code but was told that content type is set in the servlet as text/html. Our company has built a customised servlet that works like CGI. Hence there is common servlet for view rendering. Views are made in html templates.

Login has a normal login html template page and actually I havent specified the content type in html template. It is set by servlet.

Following lines get appended from servlet to the begining of html output:

Date: Wed, 12 Jan 2005 10:41:29 GMT
Server: Apache/1.3.12 (Unix) mod_jk
Content-Type: text/html
Connection: close

Above lines are appended to output view by servlet for all the pages internally.

Surprisingly the same login code as sent by the servlet is working, if i save the code on local disk as html file and then access the html through mozilla.

Sandeep
13 years ago
Hi Guys,

I have written a servlet for login purpose which works fine in IE.
But in Mozilla the same servlet though not throwing any exception is showing the html code in output instead of my login form.

More Info:
I am using content type as text/html.
My tomcat is of version 3.2 on a unix server.

What could be the problem here?

Help me solve the problem.

Sandeep
13 years ago
Hi eric

I tried with iframe. I found with iframe that it copies the content of the file into text area and as a result a file of sort is not cached. Is it security problem if i give path of file on server in a link and ask the client to download the file. In what situation(rather tags) and how the file gets cached. Please help.
Sandeep
Hi everybody

I want to do something similar to Gaurav.
But my question is the pdf file going to be downloaded to client machine.
Also i want to know how to give path of the pdf in src tag of frame. will it be absolute path of it on the server or if relative how to give relative path or url.

With regards
Sandeep
Hi guys

I have been trying hard to get some tag in html which can put my text file contents in my output html as well as download it from server to requesting client machine. I tried with embed tag but i dont is it helpful in my situation.

Please help solve my query.

Sandeep
Hi sonal

Thats certainly a compilation error.But I dont have any clue where error might be unless you specify the full error. I think besides the error that you show there should be some more message specifying error location in your JSP.

Sandeep
13 years ago
JSP
Hi Neeraj

If you have placed the process of getting the outputstream inside a try catch it will be easy to track completion depending on whether try block is successfully executed or not. A successful closing of stream can help you do what you require to do.


Sandeep
13 years ago
JSP
Hi Priya

I dont know if Using runtime.exec in JSP is a good option.
Using usebean can delgate the processing code in package .
I dont think making an extra call to a package method will do much performance overhead as it will be all on server side.

Sandeep
13 years ago
JSP
Hi amit

I think you must put a log like System.out.println(request.getParameter("db"));
before you pass it to your getConnection() so that you can check correctness of response recieved.
You may get error but as you have put the logs you will find answer to what may be wrong.

Best of luck.

Sandeep
13 years ago
JSP
Hi Guys

Thanks to Rajendra for replying to my query.
Actually there was a typing error.
Still I had to compromise on 1 matter regarding useBean tag in JSP.
The param attribute in setProperty can only be from request parameters.
If I want to use my own variable in JSP page such as a HashMap to be passed param does not pass it to the bean.
value attribute can have constants as their value. How can I pass my own refernce objects in setProperty tag using either param or value attribute.

Please Comment.

Sandeep
13 years ago
JSP
Hi Guys,

Let me tell the scenario.
I fill 6 items in a html form with action attribute going to a JSP page 'insertitems.jsp' which retrieves these items using request.getParameter(). These items are put in a HashMap.
I wrote a bean class 'mybean' with a set method setFields(HashMap) and a int getInsertedFlag(). In the class a Hashmap is its member variable.
The set method sets the hashmap sent by JSP to the beans hashmap.
The get method inserts the 6 items in database using JDBC and returns updation status.

'mybean' class has compiled and placed in a package.

The 'insertitems.jsp' uses usebean tag wth id="mybeanid" and then setproperty tag to set the hashmap.
Later using the beans id I call the get method in a scriplet like mybeanid.getinsertedFlag() instead of get property tag.
Here the Compiler gives error that the id is undefined.
'insertitems.jsp' hasnt got compiled as a result.
Cant I use beans id that way.

Please Comment.

Sandeep Deshmukh
13 years ago
JSP
I assume that you use a form tag of html to get username and password.
place the method =post attribute in the form tag bcoz default is method=get.
this might solve ur problem.
You can keep the url as of now during development to check if your username and password are actually being sent. when you complete your project or assignment just change the method=post in form tag.

Reply on success.
13 years ago
JSP