v velus

Greenhorn
+ Follow
since Sep 07, 2001
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 v velus

Hi joe,
An imege applet is loaded in netscape if click a particular position it will read an .aui file which contain xml data.This .aui file will be parsed by the DOM parser.When i try to load DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
In this line it will show error( i seperately keep this line in try block so i am sure telling this). I dont know y it happend? Can u help me?.
[ January 18, 2002: Message edited by: v velus ]
Use random access file for property file.Get the path and store it in string append that string to file.
------------------
16 years ago
/*
upload-FileUpload.java
NOTE: This file is a generated file.
Do not modify it by hand!
*/
package upload;

// custom imports for FileUpload
// add your custom import statements here
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import com.oreilly.servlet.MultipartRequest;
import java.util.*;

public class FileUpload extends javax.servlet.http.HttpServlet
{
protected boolean create() throws java.lang.Exception
{
return true;
}
public FileUpload()
{ // Constructor.
}
private void unhandledEvent( String listenerName, String methodName, java.lang.Object event )
{
}
/**
* destroy Method
*/
public void destroy()
{
super.destroy();
// TODO: implement
}
/**
* doGet Method
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType( "text/html" );
PrintWriter out = response.getWriter();
out.println("<HTML>");
out.println("<HEAD><TITLE>FileUpload</TITLE></HEAD>");
out.println("<BODY>");
out.println("<H1>FileUpload</H1>");
out.println("Hello World!");
out.println("<P>Default Implementation From PowerJ</P>");
out.println("</BODY></HTML>");
// TODO: implement
}
/**
* doPost Method
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{

PrintWriter out = response.getWriter();
try{
response.setContentType("text/html");
out.println("<HTML>");
out.println("<head><Title>Decoded Uploaded File</title><head>");
out.println("<body>");
out.println("<H1>UploadFile</h1>");
// path must be absolute to upload dir
// This is the decoder class that extracts the parameters and transfer file
// request argument = Http input stream
// c:\\temp\\upload = directory to save file
// 15*1024*1024 = 15mb max size file
MultipartRequest multi = new MultipartRequest(request, "c:\\temp\\upload",15*1024*1024);

// Lists form parameters
out.println("Params:");
Enumeration params = multi.getParameterNames();
out.println("<pre>");
while (params.hasMoreElements()) {
String name = (String)params.nextElement();
String value = multi.getParameter(name);
out.println(name + " = " + value);
}
out.println("</pre>");

// Show details of uploaded file
out.println("Files:");
Enumeration files = multi.getFileNames();
out.println("<pre>");
while (files.hasMoreElements()) {
String name = (String)files.nextElement();
String filename = multi.getFilesystemName(name);
String type = multi.getContentType(name);
File f = multi.getFile(name);
out.println("name: " + name);
out.println("filename: " + filename);
out.println("type: " + type);
if (f != null) {
out.println("f.toString(): " + f.toString());
out.println("f.getName(): " + f.getName());
out.println("f.exists(): " + f.exists());
out.println("f.length(): " + f.length());
out.println();
}
out.println("</pre>");
}
}catch (Exception e){
out.println("<pre>");
e.printStackTrace(out);
out.println("</pre>");
}
out.println("</body></html>");
}
/**
* init Method
*/
public void init(ServletConfig config) throws ServletException
{
super.init(config);
// TODO: implement
}
/****************************************
* data members
****************************************/

// add your data members here
}
16 years ago
/* convert thie programm to JSP */

/*
upload-FileUpload.java
NOTE: This file is a generated file.
Do not modify it by hand!
*/
package upload;

// custom imports for FileUpload
// add your custom import statements here
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import com.oreilly.servlet.MultipartRequest;
import java.util.*;

public class FileUpload extends javax.servlet.http.HttpServlet
{
protected boolean create() throws java.lang.Exception
{
return true;
}
public FileUpload()
{ // Constructor.
}
private void unhandledEvent( String listenerName, String methodName, java.lang.Object event )
{
}
/**
* destroy Method
*/
public void destroy()
{
super.destroy();
// TODO: implement
}
/**
* doGet Method
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType( "text/html" );
PrintWriter out = response.getWriter();
out.println("<HTML>");
out.println("<HEAD><TITLE>FileUpload</TITLE></HEAD>");
out.println("<BODY>");
out.println("<H1>FileUpload</H1>");
out.println("Hello World!");
out.println("<P>Default Implementation From PowerJ</P>");
out.println("</BODY></HTML>");
// TODO: implement
}
/**
* doPost Method
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{

PrintWriter out = response.getWriter();
try{
response.setContentType("text/html");
out.println("<HTML>");
out.println("<head><Title>Decoded Uploaded File</title><head>");
out.println("<body>");
out.println("<H1>UploadFile</h1>");
// path must be absolute to upload dir
// This is the decoder class that extracts the parameters and transfer file
// request argument = Http input stream
// c:\\temp\\upload = directory to save file
// 15*1024*1024 = 15mb max size file
MultipartRequest multi = new MultipartRequest(request, "c:\\temp\\upload",15*1024*1024);

// Lists form parameters
out.println("Params:");
Enumeration params = multi.getParameterNames();
out.println("<pre>");
while (params.hasMoreElements()) {
String name = (String)params.nextElement();
String value = multi.getParameter(name);
out.println(name + " = " + value);
}
out.println("</pre>");

// Show details of uploaded file
out.println("Files:");
Enumeration files = multi.getFileNames();
out.println("<pre>");
while (files.hasMoreElements()) {
String name = (String)files.nextElement();
String filename = multi.getFilesystemName(name);
String type = multi.getContentType(name);
File f = multi.getFile(name);
out.println("name: " + name);
out.println("filename: " + filename);
out.println("type: " + type);
if (f != null) {
out.println("f.toString(): " + f.toString());
out.println("f.getName(): " + f.getName());
out.println("f.exists(): " + f.exists());
out.println("f.length(): " + f.length());
out.println();
}
out.println("</pre>");
}
}catch (Exception e){
out.println("<pre>");
e.printStackTrace(out);
out.println("</pre>");
}
out.println("</body></html>");
}
/**
* init Method
*/
public void init(ServletConfig config) throws ServletException
{
super.init(config);
// TODO: implement
}
/****************************************
* data members
****************************************/

// add your data members here
}
16 years ago
Check out the deployment descriptor of ur Weblogic whether u give correct path r not.And be sure whether u deploy that .class file in servlet work directory bcas 404 will come when the source is not available.
16 years ago
zip the file and rename to war extension and deploy it thats all.
16 years ago
Hi,
U can create a applet with progress bar control and run inside the thread so that it will execute up to that time of loading.(this is for web based app.).
17 years ago
Hi,
I have an Xml file on client machine and i want to transfer that one to server using soap and servelt.Can any one help me?.
------------------

[This message has been edited by v velus (edited October 02, 2001).]
17 years ago
Hi,
Its difficult to pass as fine stream.Set that content type to jpg/gif.
Read it in bytes, try to pass it in http stream and save it in server.
Try this code:
FileInputStream fis=new FileInputStream(yourfilename.ext);
index=s.lastIndexOf("/");
String s1="";
for(int i=index+1;i<s.length();i++)
{
s1=s1+(s.charAt(i));
}
FileOutputStream fos=new FileOutputStream(s1);
while((c=fis.read())!=-1)
{
fos.write(c);
}
17 years ago
Hello Philips,
I am throwing back to command prompt with out any error.
Is there any error?.Like classdefnotfound,bad command or invalid j2ee path.
Any have click dos properties and increase the enviroment memory to 4096.
Still i am not able to run j2ee.i am able to run cloudscape and deploytool. But my j2ee is not running(even 4096)environment.It will tell java 2 enterprise edition ,-verbose,-stop,-help,-version and come to dos prompt without telling any error.Thanks for help much far.
You just want inccrease ur environment palce thats all.Rigth click ur msdos prompt icon and choose properties.Choose increase environment and increase it above 1000. Hope now ur problem will be solved.
Hi,
i am new to j2ee.I install j2sdkee1.3 and jdk1.3.1_01.after that when i try to run j2ee -verbose or j2ee an error "set J2EE_HOME to the path of a valid j2sdkee. I try all the sulution given in this javaranch.com.pls,help me.