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

com.github.andyshaox.servlet.mapping.PageView Maven / Gradle / Ivy

package com.github.andyshaox.servlet.mapping;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

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

/**
 * 
 * Title:
* Descript:
* Copyright: Copryright(c) Jan 25, 2016
* Encoding:UNIX UTF-8 * * @author Andy.Shao * */ public class PageView extends GenericView { private final List injections = new ArrayList<>(); public PageView() { super.viewProcess = new PageViewProcess(); } public PageView(String resource) { this(); super.resource = resource; } public void addInjection(ArgInjection injection) { this.injections.add(injection); } public void addInjection(String key , Object value) { this.addInjection(ArgInjection.defaultArgInjection(key , value)); } public void addInjection(String key , Object value , VariableLevel level) { this.addInjection(ArgInjection.defaultArgInjection(key , value , level)); } @Override public void process(ServletConfig config , HttpServletRequest request , HttpServletResponse response) throws ServletException , IOException { for (ArgInjection injection : this.injections) injection.inject(request); super.process(config , request , response); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy