[jbosstools-issues] [JBoss JIRA] (JBIDE-19395) Default template code for Servlet

Daniel Azarov (JIRA) issues at jboss.org
Tue Mar 17 16:07:19 EDT 2015


    [ https://issues.jboss.org/browse/JBIDE-19395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051157#comment-13051157 ] 

Daniel Azarov edited comment on JBIDE-19395 at 3/17/15 4:06 PM:
----------------------------------------------------------------

[~ArunGupta], how about to use
{code}
response.getWriter().append("Served at: ").append(request.getContextPath());
{code}
instead of:
{code}
response.getOutputStream().print("Served at: " + request.getContextPath());
{code}
Roberto Sanchez Herrera asked in bugzilla:
{quote}
3. Why did you decide to use response.getOutputStream(), which according to the javadoc: "Returns a ServletOutputStream suitable for writing binary data in the response", instead of response.getWriter(), which seems more appropriate (from javadoc: Returns a PrintWriter object that can send character text to the client.)
{quote}


was (Author: dazarov):
[~ArunGupta], how about to use
{code}
response.getWriter().append("Served at: ").append(request.getContextPath());
{code}
instead of:
{code}
response.getOutputStream().print("Served at: " + request.getContextPath());
{code}
Roberto Sanchez Herrera asked in bugzilla:
>3. Why did you decide to use response.getOutputStream(), which according to the javadoc: "Returns a >ServletOutputStream suitable for writing binary data in the response", instead of response.getWriter(), which seems more >appropriate (from javadoc: Returns a PrintWriter object that can send character text to the client.)

> Default template code for Servlet
> ---------------------------------
>
>                 Key: JBIDE-19395
>                 URL: https://issues.jboss.org/browse/JBIDE-19395
>             Project: Tools (JBoss Tools)
>          Issue Type: Enhancement
>          Components: upstream
>    Affects Versions: 4.3.0.Alpha1
>            Reporter: Arun Gupta
>            Assignee: Daniel Azarov
>             Fix For: 4.3.x
>
>
> It would be nice to have a default template code generated for Servlet. This will make the generated Servlet a little bit more useful, and much easier to showcase in demos.
> For example, here is one template that could be generated in doGet():
> response.getOutputStream().print("Served at: " + request.getContextPath());
> And doGet() called from doPost().



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jbosstools-issues mailing list