Haritha Gorijavolu

Greenhorn
+ Follow
since Feb 18, 2011
Haritha likes ...
Debian Java Linux
Merit badge: grant badges
For More
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
12
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Haritha Gorijavolu

I am using log4j for logging.I am using a configuration file called log4j.properties. I have placed it in the class path. The program is running fine and events are being printed to the output log.
Yet, when I run the program in eclipse in tomcat server runtime, it is giving the following errors on the console:


Can any one explain why these errors are printed on the console. Thanks in advance.

The following is my log4j.properties file




The following is the code I wrote to use it.


I am trying to do I18N in STRUTS. The problem is, I am getting only the french version of the application on each request.
Here is what I did:
I provided a form element in the index.jsp, with the hidden input field called language and it's value is "fr"
(The plan is to display initially in english and on clicking the form, change the language of the page)



The following is my struts-config.xml



On clicking the above form with the hidden input, ChangeLocaleAction class will be called and here is the code for the ChangeLocaleAction.java



I am developing in eclipse and I have the .properties files in test package of src folder.
here are the names of my .properties files
MyAppRes.properties
MyAppRes_fr.properties

I am also giving the code of LocBean



I am currently testing it in eclipse(helios) using the tomcat plugin.

Please tell me where I went wrong. Thanks in advance.

Also, I need to display the language button only when the users are viewing the english version. I don't want the language button when the user is viewing the french version. How do i achieve this?
12 years ago
Thanks, Sunmon Jaya. You suggestion was a lifeSAVER!! I finally figured the cause for my misery of last 20 hours.
12 years ago
Suppose I have a jsp called abc and a bean called xyz associated with it in struts-config.xml. When I request the webserver for abc.jsp, is the bean xyz created by the server before the requested abc.jsp(..now procesed to pure HTML) is sent to the browser?
Thanks in advance.
12 years ago
Hello. I am a struts beginner. Struts emphasizes that there be only one Action associated with each "Submitting" View. So, if I wanted to build a page where the user has numerous options, how do I do it?
12 years ago
I am using eclipse. I was told that, whenever I import a package for new functionality, I should to add it to lib folder and then right-click on it -> Build Path -> Add to build path.
What happens if I just import the package into my lib folder and leave it alone?
I don't understand whats going on behind the scenes. Why am I required to do that?
Thanks in advance.
I asked the above question out of curiosity. For example, there is a xxx.java file in some location with it's own main method. What my code is required to do is compile and run xxx.java, given the location of the file. It is possible to do this in java?
12 years ago
Got it. Thanks for explaining.
The following are the codes for client and server to exchange a file. It works like this: The client sends a connection request and the server begins to transfer the file and the client just recieves the file. The location of the file and the size of the file are predefined, for the sake of simplicity.

How is it that the client reads from the InputStream only after the Server sends the data and not before it sends data? How does it know when to start reading from InputStream? I am presently running the client and server on local host and the code is working fine.

client code:


Server code:

Thank you very much, Mr.Spoor. The code now works fine with DataInputStream and DataOutputStream.
My goal is to send an int value from one computer to another. Presently, I am running the code for sending and recieving on local host alone.
The sending code is executed by the "main" thread and the recieving code is executed by the thread that was forked from the main.The child thread also listens for incoming requests by "main" thread. When it detects a request, it calls the recieving code.

Here is the sending code:



Here is the recieving code:


I am getting the following exception:

Exception in thread "Thread-0" java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.test.Netboxbeta$reqhandler.getsize(Netboxbeta.java:99)
at com.test.Netboxbeta$reqhandler.run(Netboxbeta.java:69)
at java.lang.Thread.run(Unknown Source)

can anyone tell me why the int value is not being transfered? please help. Thanks in advance.
I have to use "web services" as services?Can any one suggest some books that would help me build web services through J2EE? I am a beginner.
12 years ago
JSP