File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes problem in passing parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "problem in passing parameters " Watch "problem in passing parameters " New topic

problem in passing parameters

Raj kalaria
Ranch Hand

Joined: Sep 08, 2005
Posts: 72

Right now our requirement is that, we should have a jsp page which will call a class which( has the logic to diplay the contents in Excell sheet)

Right now i am creating a jsp file as follow

<%@ page import="javax.servlet.http.HttpServletResponse"%>
<%@ page import='alok.*' %>
csv1 c = new csv1();

Now My java class is as follow
package alok;
import java.util.*;
import javax.servlet.jsp.JspWriter;
import javax.servlet.http.HttpServletResponse;
public class csv1 {

private static final String CONTENT_TYPE = "application/excel";

public void writefile(HttpServletResponse response, JspWriter out)throws IOException
// public void writefile()throws IOException
//HttpServletResponse response = null;
//JspWriter out = null;

StringBuffer buffer = new StringBuffer();
response.setHeader("Content-Disposition","inline; filename=\"mult-table.xls\"");

buffer.append("<Table border = 1><tr><th> Object Name </th><th> subject </th>");


Now the above code is working fine

now what i want is

right now i am passin teh parameters public void writefile(HttpServletResponse response, JspWriter out)

I dont want to pass teh parameters,
so in the method writefile( ) inside thew class
when i decalred
HttpServletResponse response = null;
JspWriter out = null;

the code is not working
can u help me
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

can u help me

JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

Please read this for more information.

Forum Bartender

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: problem in passing parameters
jQuery in Action, 3rd edition