Win a copy of Spring Boot in Practice this week in the Spring forum!

biswajit ray

Ranch Hand
+ Follow
since Nov 30, 2005
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 biswajit ray

i m facing a problem in caching the jsp page. i have written the code like

<%
// issue HTTP directives such that this page is not cached
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
%>
which means it will prevent the caching of jsp pages.But it is caching the jsp page. Please help me in this regard.

it is very urgent.
14 years ago
JSP
hi guys,

i have problem that is when i m logging out from my application i invalidate the session . but if i click on the browse back button then it is going to the previous page. i also even tried by writing the code

<%
// issue HTTP directives such that this page is not cached
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
%> in my jsp page but it is not working. please help me in ths reagrd it is urgent.
14 years ago
JSP
why can�t the following code do the job of �locate, load, and link�?

org.gjt.mm.mysql.Driver driver = new org.gjt.mm.mysql.Driver();

will it locate , load and link by executing the static block? what is the problem in it?
hi i m facing a problem in downloading an audio file. the problem is that for the first time when i m downloading an audio file by clicking an audio link it is not getting downloaded and an error is coming, but as soon as i refresh the page by clicking F5 it is running ok.so any one there please help me.it should work for the first time. i mean to say that there is no need of refreshing the page.
biswajit
15 years ago
i m facing a problem in downloading an audio file. if somebody can help me it is urgent.


biswajit
15 years ago
how to read xml data using sax parser?
/*
* Created on Mar 14, 2006
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package com.thinkways.javafiles;
import java.io.File;
import java.io.IOException;
import java.sql.Connection;
import java.util.Date;
import java.util.Enumeration;
import com.thinkways.javafiles.*;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.oreilly.servlet.MultipartRequest;
import com.oreilly.servlet.multipart.DefaultFileRenamePolicy;
/**
* @author Administrator
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class AudioRequestUpload extends HttpServlet
{

private String dirName;
//conBean ob;
// Conn con;
// Connection cn;
ContactOperation db;
MultipartRequest multi=null;

public AudioRequestUpload()
{
//con = new Conn();
// obo = new Project();
//ob=new conBean();
//private final String dirName="";
db=new ContactOperation();

}
public void doGet (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
doPost(request,response);
}

public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
//MultipartRequest multi = null;
java.io.PrintWriter out = response.getWriter();
response.setContentType("text/plain");
//out.println("i m in before try block");
try
{
System.out.println("I M HERE123####");
int adminflag = 0;
//int Audioname_Id=0;
String audioid="";
int audio_id=0;
audioid=request.getParameter("audioid");
System.out.println("<<<<audioid is>>>>>"+audioid);
audio_id=Integer.parseInt(audioid);
System.out.println("audio_id is"+audio_id);
String titlename=request.getParameter("titlename");
System.out.println("<<<<titlename is>>>>>>>"+titlename);
//int flag1=db.searchtitlename(titlename);
HttpSession session=request.getSession();
String appid=(String)session.getAttribute("APPLICATIONID") ;
System.out.println("the applicationid in the audio request upload is"+appid);
//String titlename=(String)session.getAttribute("TITLENAME");
//System.out.println("titlename is>>>>>>>>>>>"+titlename);
//String titlename=request.getParameter("n1");
// System.out.println("The TitleName in the audio request upload is>>>>>>>>>"+titlename);
dirName = request.getRealPath("/")+"AudioDocument";
//File file=new File(dirName);
//boolean t=file.isDirectory();
//System.out.println("t is "+t);
//if(t==false)
// {
// boolean r=file.mkdir();
//System.out.println("r is"+r);

// }
System.out.println("the dirname is"+dirName);
System.out.println("now i m here");
// String audio_name_Id=request.getParameter("Audioname_Id");
//System.out.println("The Audioname_Id in the request upload is"+audio_name_Id);
//String audio_id=(String)session.getAttribute("AUDIOID");
//Audioname_Id=Integer.parseInt(audioid);
//System.out.println("The Audio_id is>>"+Audioname_Id);
//String categoryname=(String)session.getAttribute("CATEGORYNAME") ;
// System.out.println("the CATEGORYNAME is"+categoryname);

//String str=(String)request.getParameter("headline");
//System.out.println("str is"+str);
//int categoryid=Integer.parseInt((String)session.getAttribute("CATEGORYID"));
//System.out.println("the categoryid is"+categoryid);
//File file=new File("AUDIO\\"+appid);
// System.out.println(request.getContextPath()+"/AUDIO/"+appid.substring(0,5));
/* boolean t;

t=file.isDirectory();*/

//System.out.println("the t is"+t);
// String path="";
// if(t==false)
//{
//System.out.println("inside if");

//boolean r=file.mkdirs();
//System.out.println("r is"+r);
System.out.println(" i m before multi");
long lastmodification=new Date().getTime();
System.out.println("lastmodification is"+lastmodification);
String lastmodify1=""+lastmodification;
try
{
multi= new MultipartRequest(request, dirName, 0xa00000, "ISO-8859-1", new DefaultFileRenamePolicy());
}
catch (Exception e){
System.out.println ("exception in upload : " + e.getMessage());
}
System.out.println("i m after for multi");

//path=file.getAbsolutePath();
//System.out.println("path is"+path);
for(Enumeration params = multi.getParameterNames(); params.hasMoreElements();)
{

String name = (String)params.nextElement();
String s = multi.getParameter(name);
}

for(Enumeration files = multi.getFileNames(); files.hasMoreElements();)
{
String name = (String)files.nextElement();
String filename1 = multi.getFilesystemName(name);
String originalFilename = multi.getOriginalFileName(name);
String type = multi.getContentType(name);
File f = multi.getFile(name);
System.out.println("inside the demorequestupload");
if(f != null)
{
// getServletContext().getRequestDispatcher("//jsp/viewpage.jsp").forward(request, response);
String filename = f.getName();
System.out.println("the filename is"+filename);
int j=filename.lastIndexOf(".");
System.out.println("j is "+j);
String format=filename.substring(j+1);
System.out.println("format is"+format);
String filepath = f.toString();
System.out.println("the filepath is"+filepath);
String version="1";
int flag=db.audiouploadsave(titlename,filepath,audio_id,appid,lastmodify1,version,format);
System.out.println("FLAG IS"+flag);
if(flag==1)
{
System.out.println("<<<<<<<<<,sucessfully saved>>>>>>>");
String message="SUCCESSFULLY UPLOADED";
session.setAttribute("MESSAGE",message);
response.sendRedirect("/MOBISYNC/jsp/Audioupload.jsp?mycheck="+1+" ");
//request.getRequestDispatcher("/jsp/a1.jsp").forward(request,response);
//getServletContext().getRequestDispatcher("/jsp/a1.jsp").forward(request, response);
//getServletContext().getRequestDispatcher("/MOBISYNC/jsp/Audioupload.jsp").forward(request, response);
////request.getRequestDispatcher("/MOBISYNC/jsp/Audioupload.jsp").forward(request,response);

}
else if(flag==2)
{
String message="THIS TITLENAME EXIST PLEASE CHOOSE ANOTHER ONE";
session.setAttribute("MESSAGEPRESENT",message);
response.sendRedirect("/MOBISYNC/jsp/Audioupload.jsp?mycheck2="+1+" ");
///getServletContext().getRequestDispatcher("/jsp/a2.jsp").forward(request, response);


}
// int flag = obo.storeFile(filename, filepath);
//int storeflag=1;
//int flag=ob.storeFile(subcategoryid,headline,filepath,filename,storeflag);
//int flag=ob.storeaudiorecord(categoryname,path,lastmodify1,appid);
// if(flag == 1)
//{
//System.out.println("file and path is saved<<<<<<<<<");

}
// else
//{
// System.out.println("not saved<<<<<<<<");
// }

}

// }

// }

// else if(t==true)
// {
// System.out.println("inside 2nd if");
//path=file.getAbsolutePath();
//MultipartRequest multi1 = new MultipartRequest(request, dirName, 0xa00000, "ISO-8859-1", new DefaultFileRenamePolicy());
// for(Enumeration params = multi1.getParameterNames(); params.hasMoreElements();)
// {

//String name = (String)params.nextElement();
// String s = multi1.getParameter(name);
// }

// for(Enumeration files = multi1.getFileNames(); files.hasMoreElements();)
// {
//String name = (String)files.nextElement();
// String filename1 = multi1.getFilesystemName(name);
// String originalFilename = multi1.getOriginalFileName(name);
// String type = multi1.getContentType(name);
// File f = multi1.getFile(name);
// System.out.println("inside the demorequestupload");
// if(f != null)
// {
// getServletContext().getRequestDispatcher("//jsp/viewpage.jsp").forward(request, response);
//String filename = f.getName();
//System.out.println("the filename is"+filename);
//String filepath = f.toString();
//System.out.println("the filepath is"+filepath);
//long lastmodification1=new Date().getTime();
//System.out.println("lastmodification is"+lastmodification1);
//String lastmodify=""+lastmodification1;
// int flag = obo.storeFile(filename, filepath);
//int storeflag=1;
//int flag=ob.storeFile(subcategoryid,headline,filepath,filename,storeflag);
//int flag=ob.storeaudiorecord(categoryname,path,lastmodify,appid);
// if(flag == 1)
//{
// System.out.println("file and path is saved<<<<<<<<<");
// getServletContext().getRequestDispatcher("/jsp/successpage.jsp").forward(request, response);
// }

// else
// {
// System.out.println("not saved");
//}
// }
//else
// {
// System.out.println("####not saved");
// }

// }

//}



}
catch(Exception lEx)
{
getServletContext().log(lEx, "error reading or saving file");
}
// }
}
}





/*public String makeDir()
{
File file = new File(System.getProperty("user.dir") + "\\brimingham\\");
file.mkdir();
return file.getAbsolutePath();
}
*/
// Conn con;
// Connection cn;
// Project obo;
// conferencebean ob;
// private String dirName;
//}
15 years ago
can somebody help me in file uploading in servlet?
15 years ago
can any body tell me how to do pagination in jsp?
15 years ago
JSP
hi all,
is there anybody who can tell me what is pagination? all i want an example of pagination along with source code.
biswajit
16 years ago
JSP
i m using mysql database. where i m storing an image file whose datatype format is blob.what i want to extract those binary data from the database and populate them in a jsp page.plz help me in this regard.
biswajit.
16 years ago
JSP
i want to upload an image file through jsp.i have a html form. from where i have an uploaded option. an intermediate jsp page is there. where the intermediate process will be done.i m using mysql database. All i want is to upload the image into the database in blob format.so that later anybody can retrive it.plz help me
biswajit
16 years ago
JSP
i m using mysql version(5.016,server).and mysqlcc 0.94(beta). when i m going to create a table in database(biswajit) i m getting an error like
[root@localhost:3306] ERROR 1146: Table 'biswajit.1' doesn't exist.though i m able to creat a table say(xyz) in the database(biswajit) but after insertion of datas in the table the datas remain nolonger valid.ie data becomes empty after i come out from the table.that means when for the second time i am opening the table all the columns are vacant with the above said error.
Plz help me in this regard.
biswajit
i m getting an error when i m creating a table in mysql.i m using mysql control center.(0.94 beta).the error is
[root@localhost:3306] ERROR 1104: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
plz help me in this regard.
biswajit
i want to install mysql(latest version) on my computer.and also mysql control center on my computer. but the thing is that after installation all these softwares on my computer an error is showing on my computer. the error is
[root@localhost:3306] ERROR 1045: Access denied for user 'root'@'localhost' (using password: NO)
plz help me in this regard