devxlogo

Reloading Java Classes in JSP Development

Reloading Java Classes in JSP Development

Question:
How can I force a reload of a JavaBean that is being used in a JSPpage? The problem is I am developing a JSP-based Web application andI need to constantly modify my Java classes and JavaBeans. All thechanges I make are invisible to the server unless I restart the server.

Answer:
Making changes to Java support classes visible to a JSP page thatuses them is dependent on the JSP/Servlet engine you are using. Atthe moment, the JDSK and the Apache Tomcat JSP/Servlet engine requirea server restart in order for a JSP page to use the newly compiledversion of a Java class.

However, changes to a JSP page are reflectedafter a simple page reload from a browser. This situation is expectedto change in future versions of Tomcat. Commercial JSP serversprobably have specific ways of dealing with this problem, but I am notacquainted with them.

devx-admin

Share the Post: