<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <% response.setHeader("Pragma", "no-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0); // Calculate the view sources url String sourceUrl = request.getContextPath()+"/viewSource.action"; com.opensymphony.xwork2.ActionInvocation inv = com.opensymphony.xwork2.ActionContext.getContext().getActionInvocation(); org.apache.struts2.dispatcher.mapper.ActionMapping mapping = org.apache.struts2.ServletActionContext.getActionMapping(); if (inv != null) { try { com.opensymphony.xwork2.util.location.Location loc = inv.getProxy().getConfig().getLocation(); sourceUrl += "?config="+(loc != null ? loc.getURI()+":"+loc.getLineNumber() : ""); } catch (Exception e) { sourceUrl += "?config="; } sourceUrl += "&className="+inv.getProxy().getConfig().getClassName(); if (inv.getResult() != null && inv.getResult() instanceof org.apache.struts2.dispatcher.StrutsResultSupport) { sourceUrl += "&page="+mapping.getNamespace()+"/"+((org.apache.struts2.dispatcher.StrutsResultSupport)inv.getResult()).getLastFinalLocation(); } } else { sourceUrl += "?page="+request.getServletPath(); } %> <%@taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %> <%@taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %> <%@taglib prefix="s" uri="/struts-tags" %> <decorator:title default="Struts2 Showcase"/>