K
Ken
Hello group,
I'm new to JSP and was having trouble creating Methods in JSP to
output html, I managed to solve it before posting. So I'll share my
obtuseness and ask another question instead.
Now I realize that the javax.servlet.jsp.JspWriter object seems to be
local to _jspService... So to get at least printing with out.print() I
would need to pass in "out" the javax.servlet.jsp.JspWriter object.
However that requires print statements instead of the normal JSP
way... I would much rather have the following work:
<%!
public void printTableSubTotal(){
%>
<p>This is a test.</p>
<%
};
%>
See what I did wrong, and was fighting with for an hour?
The second <% also needs to be <%!... Arg, the simple things. Ok
so... if I need other objects such as request, JspWriter and response
I would need to pass those in too. Just out of curiosity can I
somehow declare these at the start of the JSP page and make them
available to all my methods or would I need to derive my own JSPBase
Class... Since I am using netbeans the specific class is:
public final class ViewBatchLines_jsp extends
org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent
So make my own base class. Is it easy to change which class is used
for the JSP's? Is this desirable for considerations which I may not
have thought of?
Any other advice on output with JSP that people found useful to them?
Oh one more thing but it is IDE specific: Netbeans HTML error checking
flags the HTML 5 tag <tfoot> as an error. Does anyone know how to
change this? I know I can turn off the error checking all together,
but I would rather know how to correct this.
I'm new to JSP and was having trouble creating Methods in JSP to
output html, I managed to solve it before posting. So I'll share my
obtuseness and ask another question instead.
Now I realize that the javax.servlet.jsp.JspWriter object seems to be
local to _jspService... So to get at least printing with out.print() I
would need to pass in "out" the javax.servlet.jsp.JspWriter object.
However that requires print statements instead of the normal JSP
way... I would much rather have the following work:
<%!
public void printTableSubTotal(){
%>
<p>This is a test.</p>
<%
};
%>
See what I did wrong, and was fighting with for an hour?
The second <% also needs to be <%!... Arg, the simple things. Ok
so... if I need other objects such as request, JspWriter and response
I would need to pass those in too. Just out of curiosity can I
somehow declare these at the start of the JSP page and make them
available to all my methods or would I need to derive my own JSPBase
Class... Since I am using netbeans the specific class is:
public final class ViewBatchLines_jsp extends
org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent
So make my own base class. Is it easy to change which class is used
for the JSP's? Is this desirable for considerations which I may not
have thought of?
Any other advice on output with JSP that people found useful to them?
Oh one more thing but it is IDE specific: Netbeans HTML error checking
flags the HTML 5 tag <tfoot> as an error. Does anyone know how to
change this? I know I can turn off the error checking all together,
but I would rather know how to correct this.