subodh varshney

Greenhorn
+ Follow
since Aug 01, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by subodh varshney

yes, I m using JSP file.
content will always be text.
16 years ago
PrintWriter out1 = response.getWriter();
response.setContentType("application/octet-stream");
response.addDateHeader("Expires", 1);
response.setHeader("Content-Disposition","attachment;filename="+pagename);
out1.write(contents.substring(0,contents.length()).trim());


I m using above code it is working, but when i download file it includes some extra lines(whitespaces) in the haeder of the file
16 years ago
PrintWriter out1 = response.getWriter();
response.setContentType("application/octet-stream");
response.addDateHeader("Expires", 1);
response.setHeader("Content-Disposition","attachment;filename="+pagename);
out1.write(contents.substring(0,contents.length()).trim());


I m using above code it is working, but when i download file it includes some extra lines(whitespaces) in the haeder of the file
16 years ago
JSP
PrintWriter out1 = response.getWriter();
response.setContentType("application/octet-stream");
response.addDateHeader("Expires", 1);
response.setHeader("Content-Disposition","attachment;filename="+pagename);
out1.write(contents.substring(0,contents.length()).trim());


I m using above code it is working, but when i download file it includes some extra lines(whitespaces) in the haeder of the file
16 years ago
JSP
PrintWriter out1 = response.getWriter();
response.setContentType("application/octet-stream");
response.addDateHeader("Expires", 1);
response.setHeader("Content-Disposition","attachment;filename="+pagename);
out1.write(contents.substring(0,contents.length()).trim());
16 years ago
JSP
Hi All,
i m using following code for url connection, and getting error.
Please help me.

URL url = new URL(urlString);
HttpsURLConnection conn=(HttpsURLConnection)url.openConnection();
conn.setHostnameVerifier(new MyHostnameVerifier());
conn.setAllowUserInteraction(true);
conn.setDoOutput(false);
conn.setRequestMethod("GET");
conn.getContent();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String str="";
String str1="";
while ((str = in.readLine()) != null) {
if(!str.equalsIgnoreCase(""))
System.out.println("STR:::::"+str);
str1+=str+"\n";
}
in.close();

<-------------------I am getting following error ---------------->

java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:802)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:702)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:583)
at java.net.URLConnection.getContent(URLConnection.java:582)Unable to send the message
Hi All,

I have to pass the Javascript variable to the Java Funtion in JSP....here is the scenario..I have 2 comboboxes and I have to populate combo2 besed on the value selected in combo1... How can I do this ??


function populateCombo2()
{
var selectedIndex= document.form.combo1.selectedIndex;
alert("selectedIndex>>>>" + selectedIndex); <%
RepositorySuffix objRS = (RepositorySuffix) storedData.get(selectedIndex); %>
}
i want to read a file on server.
plz help me.
19 years ago
i want to download a file from server through servlet using inputstream.
if any one have any code plz help me.
19 years ago
Dear All,
Please help me I m facing NullPointerException.

In following code i m retreiving some values from a table and storing them in a vector.
In case of response when it get null then loop goes to NullPointerException
so remaining variables(responseflag,url,urlflag,) does't get value so again it next code gives nullpointerexception.



for (int loop = 0; loop < result.size(); loop++) {
String keyword = null; String suffix = null; String username = null;
String password = null; String response =""; String responseflag = null;
String url =""; String urlflag = null;

try {
keyword = result.elementAt(loop).toString();
suffix = result.elementAt(loop + 1).toString();
username = result.elementAt(loop + 2).toString();
password = result.elementAt(loop + 3).toString();
response = result.elementAt(loop + 4).toString();
responseflag = result.elementAt(loop + 5).toString();
url = result.elementAt(loop + 6).toString();
urlflag = result.elementAt(loop + 7).toString();

}
catch (NullPointerException ex) {
}
19 years ago
I hava a keyword "subodh2000". I want to cut the numeric from it.
From following code i have get numeric character now i m facing problem to appened those character.

for ( int i = 0; i < message.length(); i++ ) {
char c = message.charAt(i);
int j = (int) c;
if(j>=48 && j<=57)
{
String aChar = new Character(c).toString();

}
19 years ago