public Page(String title) {
this.title = title;
try {
- InputStream resource = getClass().getResourceAsStream(
- getClass().getSimpleName() + ".templ");
+ InputStream resource = getClass().getResourceAsStream(getClass().getSimpleName() + ".templ");
if (resource != null) {
- defaultTemplate = new Template(new InputStreamReader(resource,
- "UTF-8"));
+ defaultTemplate = new Template(new InputStreamReader(resource, "UTF-8"));
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
* @throws IOException
* if output goes wrong.
*/
- public boolean beforeTemplate(HttpServletRequest req,
- HttpServletResponse resp) throws IOException {
+ public boolean beforeTemplate(HttpServletRequest req, HttpServletResponse resp) throws IOException {
return false;
}
* @throws IOException
* if output goes wrong.
*/
- public abstract void doGet(HttpServletRequest req, HttpServletResponse resp)
- throws IOException;
+ public abstract void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException;
/**
* Same as {@link #doGet(HttpServletRequest, HttpServletResponse)} but for
* @throws IOException
* if output goes wrong.
*/
- public void doPost(HttpServletRequest req, HttpServletResponse resp)
- throws IOException {
+ public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
doGet(req, resp);
}
public void setTitle(String title) {
this.title = title;
}
+
public static Language getLanguage(ServletRequest req) {
return Language.getInstance("de");
}