All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.firefly.mvc.web.view.JspView Maven / Gradle / Ivy

There is a newer version: 4.0.3.2
Show newest version
package com.firefly.mvc.web.view;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.firefly.mvc.web.View;

public class JspView implements View {

	private static String VIEW_PATH;
	private final String page;
	
	public JspView(String page) {
		this.page = page;
	}
	
	public static void setViewPath(String path) {
		if(VIEW_PATH == null && path != null)
			VIEW_PATH = path;
	}

	public String getPage() {
		return page;
	}

	@Override
	public void render(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String ret = VIEW_PATH + page;
		request.getRequestDispatcher(ret).forward(request, response);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy