MCPcopy Index your code
hub / github.com/beanshell/beanshell / sendHTML

Method sendHTML

src/bsh/servlet/BshServlet.java:105–138  ·  view source on GitHub ↗
( 
		HttpServletRequest request, HttpServletResponse response,
		String script, Exception scriptError, Object scriptResult, 
		StringBuffer scriptOutput, boolean capture )

Source from the content-addressed store, hash-verified

103 }
104
105 void sendHTML(
106 HttpServletRequest request, HttpServletResponse response,
107 String script, Exception scriptError, Object scriptResult,
108 StringBuffer scriptOutput, boolean capture )
109 throws IOException
110 {
111 // Format the output using a simple templating utility
112 SimpleTemplate st = new SimpleTemplate(
113 BshServlet.class.getResource("page.template") );
114 st.replace( "version", getBshVersion() );
115
116 //String requestURI = HttpUtils.getRequestURL( request ).toString()
117 // I was told this should work
118 String requestURI = request.getRequestURI();
119
120 st.replace( "servletURL", requestURI );
121 if ( script != null )
122 st.replace( "script", script );
123 else
124 st.replace( "script", exampleScript );
125 if ( capture )
126 st.replace( "captureOutErr", "CHECKED" );
127 else
128 st.replace( "captureOutErr", "" );
129 if ( script != null )
130 st.replace( "scriptResult",
131 formatScriptResultHTML(
132 script, scriptResult, scriptError, scriptOutput ) );
133
134 response.setContentType("text/html");
135 PrintWriter out = response.getWriter();
136 st.write(out);
137 out.flush();
138 }
139
140 void sendRaw(
141 HttpServletRequest request, HttpServletResponse response,

Callers 1

doGetMethod · 0.95

Calls 7

replaceMethod · 0.95
getBshVersionMethod · 0.95
writeMethod · 0.95
flushMethod · 0.80
getWriterMethod · 0.65
getResourceMethod · 0.45

Tested by

no test coverage detected