Help coderanch get a
new server
by contributing to the fundraiser

Vanitha Sugumaran

Ranch Hand
+ Follow
since Apr 11, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Vanitha Sugumaran

Hi,

Is it possibel to upload files from client's machine to server using sockets? Please give me some examples or links to tutorials.

thanks,
how could this init param help to get the context path?
[code]
<servlet>
<servlet-name>MyServlet</servlet-name>
<display-name>MyServlet</display-name>

<init-param>
<param-name>path</param-name>
<param-value>//myTestFile/xml/defaultXmlFiles</param-value>
</init-param>

<description>Simple text servlet</description>
<servlet-class>image_gallery.MyServlet</servlet-class>
</servlet>
[code]
19 years ago
Thanks for your replies.

I don't have war files.

How would I give init param or context param to a servlet?

How would I call this servlet from java class instead of webpage?

thanks again,
19 years ago
Hi,

I tried this..



my Class file is in :

tomcatHOme\webapps\myServices\WEB-INF\classes\fileWriterTest\

I have
\Tomcat 5.5\webapps\myServices\WEB-INF\myTest\xml\defaultXmlFiles\

when i run the FileWrtierClass from command line it works fine.

but when I call this class from another application. it throws file not found error.

it should be something simple I am missing here..
19 years ago
I need to read and write from a java class which is inside Tomcat's webapps folder. (I have folder structure in my first post)

I wrote teh servlet to get the context path, but not sure how to use it.. because I need to call this servlet from a class file not a web page.

thanks,
19 years ago
Hi,

First I have posted my query here in tomcat section, but I think this would be the right forum to ask

https://coderanch.com/t/84787/Tomcat/reading-text-files

My problem:
I have my java class files in tomcat

webapps/applicationName/JavaFiles/classes/JavaHelper.class

Text File folder is in

webapps/webResources/textFiles/*.txt

I need to get my helper java class to read and write the text file in 'textFiles' folder?

so from Tomcat section I got the response to write a servlet and get the context path. I don't have requests for the servlets from a webpage,

how can a java class request a servlet?



1)Can this be possible?

2)Is there any other way to do this without servlets?

Thanks.
19 years ago
Thanks for your reply.

From a java class file how can I call a servlet? what is config in the above example? Sorry I am just confused and new to servlet concept.

BufferedReader infile = new BufferedReader(new FileReader(config.getServletContext().getRealPath("path_to_your_file")));?

thanks,
19 years ago
I have to read from a text file from java helper class which is under tomcat's web-inf directory. I am not sure how to load the file from the java class?
right now

ReaderClass rc = new ReaderClass("C:\\myClass\\test.txt");

but when I keept hte class file inside tomcat this will NOT work. any suggestions?

thanks,
19 years ago
hi,
Is there any way to fire an event to jcombobox in code? like we do in button.doclick()?
thanks,
20 years ago
I read it in "Intro to Software Testing" by Louise Tamres. Chap 9 Creating Quality software.
he explaines that "Bottom-up", "Top-down" are kind of integration strategies. bottom-up: merge the units and test from bottom-up. Top-down: merge units and test from top-down.
thanks,
20 years ago
Thanks for your reply.
why is drivers used in "Bottom-up" fashion(Integration Testing) and Stubs are used in Top-down fashion.
doesn't drivers help in top-down fashion and stubs in bottom-up fashion
thanks,
20 years ago
Hi,
I was reading about setting up a testing environment, where the author has wrote about drivers are some software utility to send tester's input, can anyone give me some example? and also he has mentioned that drivers are very useful when we do bottom-up testing.
thanks
20 years ago
Should I repost this question in JDBC forum?
thanks,
Thanks a lot Nathan for your help.
I have used another panel to display the image using getScaledinstance() thanks again,
20 years ago
I am trying to use getScaledInstance method in a small prg.
this is what I have in my paint method.

The image2's width is 200, but height is always -1 why? Original image's height is 640, widht is 480.
Can you anyone tell me how to use the getScaledInstance method?
thanks,
20 years ago