Komal Amaresh

Ranch Hand
+ Follow
since Oct 06, 2008
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 Komal Amaresh

Hi

I've been trying to run a simple servlet for 2 days but couldn't neither in the eclipse ide nor through the command prompt by creating a war file.
Its been a year since i have touched java, and now at this stage i feel despicable.
the servlet is getting compiled as i set the classpath on the command prompt making servlet-api.jar availabe. I'am creating the WEB-INF folder inside which i placed the web.xml and classes folder. Inside the classes folder i'am placing the class file. All these inside a folder named project1. finally creating the war file using the path

jar -cvf one.war project1

.
I'm placing the war file in the webapps folder of tomcat5.5 which im using.
Im able to start tomcat properly on the command prompt. my project is being displayed in the apps of the tomcat mager page. once i click it it displays

Http error 404
The requested resource is not available



I just am not able to resolve it.

please help me.

thanks and regards
komal
9 years ago
Hi,

I have resumed working on java after an extremely long gap. i used to work with the jdk 5.
I 'am now trying java 7. there seems to be some revolutionarry changes. when i was using jdk 5, on the command line, i had to set the path and classpath variables which i used to run as batch file without which i could not execute the code.
Yesterday, I had installed java 7 on my system and after setting the path in the environment variable, i could run a simple java code on the command line. I had not set the "classpath" as i found the jdk 7 hierarchy quite confusing. yet without the classpath variable, i could run my code. i wish you could expand on the modifications that have been brought about.
Furthermore, has the classpath become redundant. if not, what is the location of the lib folder that needs to be used.

i'd really eager to know more.

thanks,
Komal
9 years ago
I' ve got it. There was no need to call a servlet at the first instance.
I just wanted to try a pop up. I had static data in the model, therefore. Further, I just had to pass the list to jsp by calling an instance pf the model. the attribute set was returning null as I was returning the action to servlet from the jsp.
This is my opinion. I hope I' am right. There were values in the list i had set as the attribute. But the error displayed was in the loop I was running in the jsp and at the requestdispatcher i had forwarded to the jsp.

Please let me know if I' am right.

regards,
Komal.
11 years ago
JSP
Hi,

I want to display a jsp an a popup on clicking a hyperlink.
I' am setting the values using a bean and storing the values in a list and setting the attribute in a servlet, in the session.
I' am then calling this servlet on action on the form by which I' am retrieving the attributes in the DisplayData.jsp.
The initial page is the index.jsp which needs no action on which I have displayed the hyperlink.

the js code is as follows


The link is set as


This is throwing a null pointer exception.
I' am unable to understand the null pointer exception.

regards,
komal

11 years ago
JSP
Hi,

I' am selecting the month and year in a dropdown on a jsp say a.jsp and retrieving the data in another jsp 'b.jsp' . Now i' am including the data b.jsp in the same jsp, a.jsp. But, once the request is commited, and the data is displayed in the b.jsp, I ' am unable to retain the selected month year. How can I retain the data, once commited.

This is urgent. Please help me.

Thanks in advance,

komal
11 years ago
JSP
Hi,

I just read a post on sessions and you mention that there is no session in a jsp.
If so, how is it possible that we are able to retrieve the attributes in a session on a jsp.

Further, how can i check the session state on the welcome page once i login which displays only data and where the action the page itself and not a servlet.

thanks in advance,

regards,
Komal


11 years ago
JSP
Hi,

I' am retrieving data in HashMaps for multiple columns to be displayed in a jsp from two database tables. As I' am calling the data from two tables, the columns set as the key in each hashmap is not present in both tables. Thereby passing the values in a bean to be displayed on a jsp returns a null pointer exception as the keys for all the values are not the same. In such cases, the data on the jsp the data may be be set as a blank column. but first i need a way to handle the nullpointerexception.
Please help me.

Thanks in advance,
regards,
Komal
11 years ago
Hi,

Yes, though I could use js to resolve it, I still would like to know if there is a way to do it on the server side.
I tried the following way.

The above code in the jsp when called in the servlet is retieving the first record's id.
I doubt passing an int to the name of the button will help as follows.
In the jsp, I set the values as follows.

In the servlet....


How can I do it?

thanks and regards.
Komal
11 years ago
Hi,

That dosen't seem possible. As the value is what that is displayed in the page. I tried passing the value to the name and id attributes, but even that was not helping as request.getparameter needs to specified to call an action and it was not possible to retrieve the value prior to the action, but I used js to pass the value onclick to the form calling the value on action in the url. That worked.
Thanks a lot.

regards,
Komal
11 years ago
Hi,

I'am displaying a table in a jsp with different with a button in each row with the same value. I' am calling all the action in the servlet. Now on submit I need to update the rows in the database and the page. i' am passing a hidden field with the id of each row after every button in the jsp. When i call the action in the servlet, it is taking the id of the first record and updating it. I' am unable to call the action on a specific record and update it. Please help me how to do it.

Thanks in advance,

regards,
Komal
11 years ago
Hi,

I' am sending a html form in a mail.
I passing all the required attributes as parameters in an html. There seems to be problem the way they are aligned.


I have included all the tags within the html as placeholders in a table. The links are used to send the reply back to user.
The error message shown in the editor is that the href is not closed.
How can i rectify this.

Thanks in advance,

regards,
Komal
Hi,

I dont really know how to work it out.
I have a table displaying a list of holidays with three columns, the date, the occassion and the state displayed as a checkbox. If the checkbox is checked, it I should be able to edit the occasion name otherwise it should not be editable. Please help me with some example code.

Thanks in advance,

regards,
Komal
Hi,

I sending an html from in the mail displaying the details of the leave parameters in a table. to allow the manager to approve application , I' am displaying hyperlinks to approve or reject the request. The servlet called from the href displays all the data passed in the hyperlink in the url as I' am not able to use the post method. Is is possible to display a button in the mail. Besides, once the approve link is clicked , is there a way to prevent the browser from opening a new page where the url is being displayed.
I think a button could resolve the issue or either just stop the data from opening in the url.

Please help me .
regards,
Komal
11 years ago
Hi,

I' am not able to connect to the smtp server. I' am running the MailSender class as a standalone application in which I have included the code above. Now I have tried including transport.connect() where it is throwing an exception.
The exception in the standalone code is as follows:


javax.mail.MessagingException: Exception reading response;
nested exception is:
java.net.SocketException: Connection reset
at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1090)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:986)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:197)
at javax.mail.Service.connect(Service.java:255)
at javax.mail.Service.connect(Service.java:134)
at javax.mail.Service.connect(Service.java:86)
at com.sun.mail.smtp.SMTPTransport.connect(SMTPTransport.java:104)
at com.tanla.lms.MailSender.sendMail(MailSender.java:116)
at com.tanla.lms.MailSender.main(MailSender.java:281)



The exception is thrown in the line transport.connect()
Should I use SMTPtransport instead of Transport? I have o fix this.
I had never worked on javax.mail earlier. Now I dont have a clue whats creating the problem.
I would be glad if you can help identify where the problem is and rectify my code.
Thanks in advance.

regards,
Komal

11 years ago
Hi,

I' am trying to send a mail and there is a messaging exception being raised at the Transport class.
I' am using the following code to send a mail.


There is a messaging ezception thrown as it reaches the line where I' am passing the message. The message ia html content sent as an array of bytes used in a different application.
The exception thrown is as follows:

A messaging excepttion is thrown at Transport.send(message).
Can you help me resolve the issue. I need to resolve this immediately.

Thanks and regards,
Komal
11 years ago