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

The following examples show how to use javax.servlet.ServletException#setStackTrace() . 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
Source File: ContribRes.java    From openprodoc with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 *
 * @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
Source File: ContribAdd.java    From openprodoc with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 *
 * @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
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@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
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@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
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@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
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@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
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@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
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@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
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@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
Source File: ContribLogin.java    From openprodoc with GNU Affero General Public License v3.0 4 votes vote down vote up
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
Source File: ContribList.java    From openprodoc with GNU Affero General Public License v3.0 4 votes vote down vote up
/**
 *
 * @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;
    }
}