Hi,
I have a jsp file which call java class file function passing connection as a parameter all was working fine once but when i changed few code in java file and compli it complied successfully but jsp file still giving previous class function output.
I am working on amezon server so not getting that problem is in my code or at server side?

Thanks in advance.

Recommended Answers

All 5 Replies

After changing the java code in .java file and compiling it , did you restart the server?
Server restart is must if class files are modified.

If only jsp files are changed server restart is not required.

Please verify your server logs, if a restart has happened on server side?

its not in my hand to restart the server any other solution.

If server restart is not under your control, then servers will be restarted daily (maybe)at midnight or weekly during sundays(weekends) .
You will definitely know when the infrastructure team will be bouncing the servers (means restart the server) due to maintenance or routine activities.
So you need to wait until the infrastructure team of your organization bounce the server for their routine work.

Normally the server bounce happens to truncate the growing server log files or some OS_PATCH upgradation

I think the question is, how do you make Java code available to a JSP?

In web applications, this means the class file must exist under WEB-INF/classes in the application's .war file or directory, in the usual directory structure matching its package. So, compile and deploy this code along with all of your other application Java code, and it should be in the right place.

Note you will need to import your class in the JSP, or use the fully-qualified class name, but otherwise you can write whatever Java code you like using the <% %> syntax.

You could also declare a method in some other utility JSP, using <%! %> syntax (note the !), import the JSP, and then call the method declared in such a block. This is bad style though.

I got the solution.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.