Java Code Examples for javax.servlet.ServletException#setStackTrace()

The following examples show how to use javax.servlet.ServletException#setStackTrace() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 *
 * @param Req
 * @throws javax.servlet.ServletException
 * @throws java.io.IOException
 */
@Override
protected void processRequest(HttpServletRequest Req, HttpServletResponse response) throws ServletException, IOException
{   
DriverGeneric LocalSess=null;
try {
Req.setCharacterEncoding("UTF-8");
ContribConf ConfContr=getContribConf(Req);
LocalSess=ProdocFW.getSession(getConnector(), ConfContr.getUser(), ConfContr.getPass()); 
PDFolders F=getContribFolder(Req);
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter(); 
F.setDrv(LocalSess);
out.println(GenHtml(Req, LocalSess, ConfContr, F)); 
ProdocFW.freeSesion(getConnector(), LocalSess);
} catch (Exception Ex)
    {
    if (LocalSess!=null)  
        try {
        ProdocFW.freeSesion(getConnector(), LocalSess);
        } catch (Exception e){}
    ServletException SE= new ServletException(Ex.getLocalizedMessage());
    SE.setStackTrace(Ex.getStackTrace());
    throw SE;
    }
}
 
Example 2
/**
 *
 * @param Req
 * @throws javax.servlet.ServletException
 * @throws java.io.IOException
 */
@Override
protected void processRequest(HttpServletRequest Req, HttpServletResponse response) throws ServletException, IOException
{   
DriverGeneric LocalSess=null;
try {
ContribConf ConfContr=getContribConf(Req);
LocalSess=ProdocFW.getSession(getConnector(), ConfContr.getUser(), ConfContr.getPass()); 
PDFolders F=getContribFolder(Req);
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter(); 
F.setDrv(LocalSess);
out.println(GenHtml(Req, LocalSess, ConfContr, F)); 
ProdocFW.freeSesion(getConnector(), LocalSess);
} catch (Exception Ex)
    {
    if (LocalSess!=null)  
        try {
        ProdocFW.freeSesion(getConnector(), LocalSess);
        } catch (Exception e){}
    ServletException SE= new ServletException(Ex.getLocalizedMessage());
    SE.setStackTrace(Ex.getStackTrace());
    throw SE;
    }
}
 
Example 3
@Override
public final ServletException couldNotInstantiateComponent(final String name, final Exception e) {
    final ServletException result = new ServletException(String.format(getLoggingLocale(), couldNotInstantiateComponent$str(), name), e);
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 4
@Override
public final ServletException notAMultiPartRequest() {
    final ServletException result = new ServletException(String.format(getLoggingLocale(), notAMultiPartRequest$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 5
@Override
public final ServletException userAlreadyLoggedIn() {
    final ServletException result = new ServletException(String.format(getLoggingLocale(), userAlreadyLoggedIn$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 6
@Override
public final ServletException loginFailed() {
    final ServletException result = new ServletException(String.format(getLoggingLocale(), loginFailed$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 7
@Override
public final ServletException authenticationFailed() {
    final ServletException result = new ServletException(String.format(getLoggingLocale(), authenticationFailed$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 8
@Override
public final ServletException noWebSocketHandler() {
    final ServletException result = new ServletException(String.format(getLoggingLocale(), noWebSocketHandler$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 9
@Override
public final ServletException deploymentStopped(final String deployment) {
    final ServletException result = new ServletException(String.format(getLoggingLocale(), deploymentStopped$str(), deployment));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 10
static void ShowLoginContrib(HttpServletRequest Req, HttpServletResponse response) throws ServletException, IOException
{   
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter(); 
DriverGeneric LocalSess=null;
try {
if (!OPDFWLoaded)  
    {
    ProdocFW.InitProdoc("PD", getProdocProperRef());
    OPDFWLoaded=true;
    }
String IdContrib=Req.getParameter("Id"); 
if (IdContrib==null)
    throw new Exception("Inexistent Contrib Form");
if (IsCacheExpired()) 
    CleanCache();
ContribConf ConfContr=Confs.get(IdContrib);
if (ConfContr==null)
    {
    ConfContr=new ContribConf(IdContrib);
    ConfContr.AssignConf(getContribProperties(IdContrib));
    Confs.put(IdContrib, ConfContr);
    }
setContribConf(Req, ConfContr);
setContribFolder(Req, null);    
LocalSess=ProdocFW.getSession(getConnector(), ConfContr.getUser(), ConfContr.getPass());   
if (ContribLogins.containsKey(IdContrib))
    out.println(ContribLogins.get(IdContrib));   
else
    out.println(GenHtml(Req, ConfContr, LocalSess)); 
ProdocFW.freeSesion(getConnector(), LocalSess);
} catch (Exception Ex)
    {
    if (LocalSess!=null)  
        try {
        ProdocFW.freeSesion(getConnector(), LocalSess);
        } catch (Exception e){}
    ServletException SE= new ServletException(Ex.getLocalizedMessage());
    SE.setStackTrace(Ex.getStackTrace());
    throw SE;
    }
}
 
Example 11
/**
 *
 * @param Req
 * @throws javax.servlet.ServletException
 * @throws java.io.IOException
 */
@Override
protected void processRequest(HttpServletRequest Req, HttpServletResponse response) throws ServletException, IOException
{   
DriverGeneric LocalSess=null;
try {
if (!OPDFWLoaded)  
    {
    ProdocFW.InitProdoc("PD", getProdocProperRef());
    OPDFWLoaded=true;
    }
Req.setCharacterEncoding("UTF-8");
ContribConf ConfContr=getContribConf(Req);
LocalSess=ProdocFW.getSession(getConnector(), ConfContr.getUser(), ConfContr.getPass()); 
PDFolders F=getContribFolder(Req);
if (F==null) // direct from login
    {
    F=CheckFolder(Req, LocalSess, ConfContr);
    if (F==null) // non existing folder
        {
        if (ConfContr.isOpenContrib()) 
            {
            F=new PDFolders(LocalSess, ConfContr.getLoginFolderType());
            F.getRecSum();
            Vector<String> FToRead = ConfContr.getFieldsToRead();
            for (int i = 0; i < FToRead.size(); i++)
                {
                String Field = FToRead.elementAt(i);
                F.getRecSum().getAttr(Field).Import(Req.getParameter(Field));
                }
            PDFolders Ftmp=new PDFolders(LocalSess);
            F.setParentId(Ftmp.getIdPath(ConfContr.getBaseFolder()));
            F.setTitle("Title_"+System.currentTimeMillis()); // set an task event
            F.insert();
            } 
        else  // Access forbiden
            {
            ProdocFW.freeSesion(getConnector(), LocalSess);
            ContribLogin.ShowLoginContrib(Req, response);
            return;
            }
        }
    setContribFolder(Req, F);    
    }
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter(); 
F.setDrv(LocalSess);
out.println(GenHtml(Req, LocalSess, ConfContr, F)); 
ProdocFW.freeSesion(getConnector(), LocalSess);
} catch (Exception Ex)
    {
    if (LocalSess!=null)  
        try {
        ProdocFW.freeSesion(getConnector(), LocalSess);
        } catch (Exception e){}
    ServletException SE= new ServletException(Ex.getLocalizedMessage());
    SE.setStackTrace(Ex.getStackTrace());
    throw SE;
    }
}