📄 main_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
import org.ofbiz.base.util.UtilProperties;
import com.sourcetap.sfa.ui.UIXMLFileUtil;
import java.util.List;
import java.util.ArrayList;
import org.ofbiz.entity.*;
import org.ofbiz.entity.model.*;
import org.ofbiz.base.util.*;
public class main_jsp extends HttpJspBase {
private static java.util.Vector _jspx_includes;
static {
_jspx_includes = new java.util.Vector(1);
_jspx_includes.add("/includes/windowTitle.jsp");
}
public java.util.List getIncludes() {
return _jspx_includes;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
javax.servlet.jsp.PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html;charset=ISO-8859-1");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
org.ofbiz.entity.GenericDelegator delegator = null;
synchronized (application) {
delegator = (org.ofbiz.entity.GenericDelegator) pageContext.getAttribute("delegator", PageContext.APPLICATION_SCOPE);
if (delegator == null){
throw new java.lang.InstantiationException("bean delegator not found within scope");
}
}
out.write("\r\n\r\n");
String contextRoot=(String)request.getAttribute("_CONTEXT_ROOT_");
out.write("\r\n\r\n");
String companyName = UtilProperties.getPropertyValue(contextRoot + "/WEB-INF/sfa.properties", "company.name");
out.write("\r\n");
String clientRequest = (String)session.getAttribute("_CLIENT_REQUEST_");
//out.write("Client request: " + clientRequest + "<BR>");
String hostName = "";
if (clientRequest!=null && clientRequest.indexOf("//") > 0) {
int startPos = clientRequest.indexOf("//") + 2;
int endPos = clientRequest.indexOf(":", startPos);
if ( endPos < startPos )
endPos = clientRequest.indexOf("/", startPos);
if ( endPos < startPos )
hostName = clientRequest.substring(startPos);
else
hostName = clientRequest.substring(startPos, endPos);
} else {
hostName = "";
}
//out.write("Host name: " + hostName + "<BR>");
out.write("\r\n\r\n");
out.write("<title>");
out.print(hostName);
out.write(" - Sales Force Automation - ");
out.print(companyName);
out.write("</title>\r\n\r\n");
out.write("\r\n\r\n");
//The incoming request is from a WAP Phone, send it to the WAP interface.
if(request.getHeader("x-up-subno") != null){
RequestDispatcher rd = request.getRequestDispatcher("login.wml.jsp");
if(rd != null) rd.forward(request,response);
}
// check to see if the database has been initialized
List screensGV = delegator.findAll("UiScreen");
if ( screensGV.size() == 0 )
{
Debug.logError("Sysyem has not been initialized. Loading Data now", "main");
String filePath = System.getProperty("ofbiz.home");
filePath += "/hot-deploy/sfa/sfadb";
try {
int rows = UIXMLFileUtil.loadAll(delegator, filePath);
Debug.logError("loaded " + rows, "main" );
}
catch ( Exception e )
{
Debug.logError(e, "main");
}
}
out.write("\r\n\r\n");
out.write("<FRAMESET cols = \"90,*\" frameborder=yes bordercolor=silver>\r\n ");
out.write("<FRAME name=menu id=menu SRC=\"/sfa/control/menu\" SCROLLING=\"No\">");
out.write("</FRAME>\r\n ");
out.write("<FRAME name=\"mainwindow\" id=\"mainwindow\" SRC=\"/sfa/control/mainwindow\" frameborder=0>");
out.write("</frame>\r\n");
out.write("</FRAMESET>\r\n\r\n");
out.write("</head>\r\n");
} catch (Throwable t) {
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -