Most novices misunderstand the flow of web applications.
When response is sended back to browser, browser do not have
any special knowledge who generated request (servlet, jsp, struts(manual?,jsp?,velocity?)).
But you can pass this information by yourself. For example, generate hidden
field in response form, so your next submit processing can investigate this parameter.
--> Render response
Servlet -->
out.print("<input type='hidden' name='generator' value='servlet'/>");
Jsp -->
<%= ssdsd %><input type='hidden' name='generator' value='jsp'/>
--> Submit
-->
String gen = request.getParameter("generator");
if (gen != null && gen.equals("jsp")) {
...
} else {
......