madhavi prasad

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

Recent posts by madhavi prasad

Hi all

Below r the my pathsettings

CATALINA_HOME d:\tomcat 5.0
JAVA_HOME f:\JAVA\J2SDK
J2EE_HOME F:\JAVA\j2sdkee1.3.1
CLASSPATH .;%CATALINA_HOME%\common\lib\servlet-2.2.jar;
F:\JAVA\fop-0.20.5\lib;F:\JAVA\fop-0.20.5\build\fop.jar;
F:\JAVA\fop-0.20.5\lib\avalon.jar;F:\JAVA\fop-0.20.5\lib\batik.jar;
%J2EE_HOME%\lib\j2ee.jar;%JAVA_HOME%\jre\lib\ext;%J2EE_HOME%\lib\j2eetools.jar;

I have included j2ee.jar file and j2eetools.jar file in the class.when im compiling the java files im getting compile time error.

Thnx
But i cant do that way.
The requirement is some thing like this.
Im quering some values from the database and showing them in the table format in a jsp page. One of the column is download img. When i click on that I need to download the file from the server and place it on the client machine, sec task is after completion of first task that is savin gto the client machine it has to open the Microsoft Outlook and that file should as the attachment(Here user dont hav to attach the file.).

How do i achive this .
19 years ago
JSP
Thnx for the tip. I will try to follow from now can.
can any one giv me sample code whoch file save the file from server to the client machine.

Thnx
19 years ago
JSP
Hi all,

In my project i need to download the file to the client machine from my server, Below is the code, its downloading the file but saving the file in the server itself. I want it to save in the client machine. Pls help me out guys. Im not getting where im going wrong.

<%@ page language="java"
import="java.lang.*,java.io.*, com.utils.*,
java.sql.*,
listener.*,java.net.URL,java.net.URLConnection" %>

<%@ include file="Connection.jsp" %>



<%

String path = request.getContextPath();

String basePath =
request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";



// Check for valid session

if (session.getAttribute("logged") ==
null)
response.sendRedirect("../htmls/InvalidSession.html");

%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">

<HTML>

<HEAD>

<link rel="stylesheet"
type="text/css" href="../styles/Portal.css">

</HEAD>

<BODY>

<%

String repoDir =
request.getParameter("repoDir");

String fileName =
request.getParameter("fileName");

String docId =
request.getParameter("fileId");

String folderName =
request.getParameter("folderName");

%>

<%

String docPath = "";

String outdocPath = "";

DataInputStream in=null;

DataOutputStream ffout=null;

FileOutputStream fOut=null;


docPath="http://webdevelop-5:8080/Maddy/" + repoDir +
"/" + folderName + "/" + fileName;

//basePath + repoDir + "/" +
folderName + "/" + fileName;

try

{




URL remoteFile=new URL(docPath);


URLConnection
fileStream=remoteFile.openConnection();


// Open the input streams for the
remote file


fOut=new
FileOutputStream("c://"+fileName);




// Open the output streams for saving
this file on disk


ffout=new DataOutputStream(fOut);


in=new
DataInputStream(fileStream.getInputStream());


int data;


while((data=in.read())!=-1){


fOut.write(data);


}


in.close();


fOut.flush();


fOut.close();





}

catch(Exception e)

{

%>

<jsp:forward
page="MessagePage.jsp">


<jsp aram name="mess" value="<%=e.toString()%>" />


<jsp aram name="messType" value="Error" />


<jsp aram name="title" value="Error Message" />

</jsp:forward>

<%

}

%>

<a href ='mailto:?subject=Company
news&attachments=""c:\<%=fileName%>""'>email</a>

</BODY>

</HTML>
19 years ago
JSP
Hi all,

Im new to JAVA Mail . My requirement is i need to send a file as an attachment can any one give me any references to links, r sample code.

Thnx in advace
19 years ago
Hi all,

I want some information regarding Documentum. How it is used with java, what is the purpose of using Documentum , what wxactly is that.

Thnx in advance
Madhavi
Hi all,

I have problem in compiling My Tag handler class.Its not identifying the packages (javax.servlet.jsp,javax.servlet.tagext).
I have copied teh servlet.jar into lib folder and i have set the path also.
I dont where im going wrong.
Thanx in advance

Regards
Madhavi
[ August 04, 2005: Message edited by: Bear Bibeault ]
19 years ago
JSP
Hi all,

The out put of the below code is 10 & 40 can any explain me how it is 10 and 40.

public class Pass{
static int j=20;
public static void main(String argv[]){
int i=10;
Pass p = new Pass();
p.amethod(i);
System.out.println(i);
System.out.println(j);
}

public void amethod(int x){
x=x*2;
j=j*2;
}
}
20 years ago
I dont hav any other program to chk
but i hav tried giving gif images of small size
even no out put how do i solve this
20 years ago
Hi,

When i have given the path
eg: madhavi=getImage( getCodeBase(), "C:\\M1.JPEG" );
it is throwing nullpointer exception
at the below line
g.drawImage( madhavi , 25 , 25 , this )
20 years ago
I tried printing the url of the image
its printing sun.awt.windows.WImage@10da5ed
i dont know from where it is picking above url
my .java,.class,.htmland .jpeg files are in c drive.

guys help me out ..........
20 years ago
Your assumption is corect.Class file is also in the same directory.No class is not in jar file.Width and height are 900/900.still not able to get.........
20 years ago
Offcourse yes , they r in the same directory......
20 years ago
Hi,

I have downloaded the folowing code from javaranch site.
Able to compile the java prog, im getting msg applet started at the status bar but image is not getting loaded,I tried printing the msg in the where im calling g.drawImage () method.String is displayed on the applet but image is not coming.can any one tel what could be the reason .

thnx & regards
madhavi


import java.applet.* ;
import java.awt.* ;

public class LoadAGifMsg extends Applet
{
private Image theHorse ;
private Image theMoose ;
private boolean showWaitMsg = true ; // will be set to false after image downloads

public void init()
{
// anything in here will run BEFORE the paint() method is called,
// even if you call repaint() now inside init
} // close init

public void loadGraphics()
{
// now load the graphics - this is like your "real" init
theHorse = getImage( getCodeBase() , "M1.JPEG" );
theMoose = getImage( getCodeBase() , "M2.JPEG" );
MediaTracker mt = new MediaTracker( this );
mt.addImage( theHorse , 0 );
mt.addImage( theMoose , 1 );

try
{
mt.waitForAll(); // block here until images are downloaded
}
catch ( InterruptedException e )
{
}

showWaitMsg = false ; // it is safe for paint to draw the image now
repaint();
} // close loadGraphics

public void paint( Graphics g )
{
// test a boolean to if the "loading" message should be displayed
if ( showWaitMsg )
{
g.drawString( "Please wait... loading..." , 20 , 20 );
loadGraphics(); // call the method that actually loads the graphics
}
else
{
g.drawImage( theHorse , 25 , 25 , this );
g.drawImage( theMoose , 25 , 130 , this );
}
} // close paint
}
20 years ago