DoGet() method is being called every 3inutes repetitively in servlet

HI,
There are 2 managed servers in one unix box.
i have one war application deployed in cluster level. This war application will search the logs and will give particular content as a result.
The Jsp page will send the request and it is able to get the correct results if the operation completes within 3 minutes. if there are so many logs, it is giving unreliable results as war application is sending the request again and again in the interval of 3 mins.
Request parameters are getting by servlet, and this servlet will create the unix shellscript in background and it will execute in a box.
0-3 mins 1st .sh creating and executing..
3-6 mins 2nd .sh creats and starts the execution, once the 1 one is completed...
its becomes infinite loop...
after some time Browser is going to diagnostic error state..
i did debugging there i can see doGet method of servlet is being called for every 3 minutes..
to avoid this i tried to give some parameters in weblogic.xml file...but its not working..
please fine below weblogic.xml file
====================================
<?xml version='1.0' encoding='UTF-8'?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.2/weblogic-web-app.xsd">
<session-descriptor>
</session-descriptor>
<jsp-descriptor>
<page-check-seconds>-1</page-check-seconds>
<debug>true</debug>
</jsp-descriptor>
<container-descriptor>
<resource-reload-check-secs>-1</resource-reload-check-secs>
<servlet-reload-check-secs>-1</servlet-reload-check-secs>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
<logging>
<log-filename>/wls_domains/b2borap2/application_MT/logs/messagetracker.log</log-filename>
</logging>
</weblogic-web-app>
=======================================================
and web.xml file is
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<listener>
<listener-class>
com.tm.messagetracker.listeners.MTrackerSession
</listener-class>
</listener>
<servlet>
<servlet-name>Controller</servlet-name>
<servlet-class>com.tm.messagetracker.Controller</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Controller</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>htm</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
=========================================
please find the servlet code..
public class Controller extends HttpServlet
public void init()
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
     System.out.println("Iam at doGet");
res.setContentType("text/html");
HttpSession session = req.getSession (false);
if (session==null) {
     // We Send a Redirect
     res.sendRedirect("./../pages/login.jsp");
//HttpSession session = req.getSession(true);
boolean loginTravelled = new Boolean((String)session.getAttribute("loginTravelled")).booleanValue();
UserVerification uv = new UserVerification();
MTUtils mTUtils = new MTUtils();
Properties systemProps = SerializeProperties.doLoad();
int noOFrecordsPerPage = 10;
if (loginTravelled)
     System.out.println("loginTravelled value :"+loginTravelled);
String pageId = req.getParameter("pageId");
String actionId = req.getParameter("actionId");
if (actionId.equals("logout"))
session.removeAttribute("CompleteSearchRecords");
session.removeAttribute("DisplaySearchRecords");
session.invalidate();
System.gc();
res.sendRedirect("./../pages/login.jsp");
else if (pageId.equals("faq"))
if (actionId.equals("homepage"))
System.gc();
res.sendRedirect("./../pages/login.jsp");
else if (actionId.equals("download"))
String fileName = req.getParameter("fileName");
String originalFileName = req.getParameter("originalFileName");
doDownload(req, res, fileName, originalFileName);
else if (pageId.equals("login"))
if (actionId.equals("downloads"))
List downloadListRecords = null;
try
downloadListRecords = DownloadableRecords.getDownloadableRecords(new File(systemProps.getProperty("faq")));
catch (Exception e)
e.printStackTrace();
session.setAttribute("DownloadListRecords", downloadListRecords);
res.sendRedirect("./../pages/downloads.jsp");
else if (actionId.equals("userlogin"))
String userId = req.getParameter("uname").trim();
String password = req.getParameter("passwd").trim();
if ((userId != null) && (userId.length() > 0) && (password != null) && (password.length() > 0))
if ((userId.equals("superadmin")) && (password.equals("superadmin")))
res.sendRedirect("./../pages/admin.jsp");
String userAuthMsg = UserVerification.verifyUser(userId, password);
if (userAuthMsg.equals("adminuser"))
res.sendRedirect("./../pages/admin.jsp");
else if (userAuthMsg.equals("guestuser"))
res.sendRedirect("./../pages/search.jsp");
else if (userAuthMsg.equals("wrongpassword"))
res.sendRedirect("./../pages/login.jsp?userAuthDispMsg=Sorry wrong password");
else if (userAuthMsg.equals("unauthorizeduser"))
res.sendRedirect("./../pages/login.jsp?userAuthDispMsg=User is not Authorized ");
else if ((userAuthMsg.equals("adminpropsNotFound")) || (userAuthMsg.equals("guestpropsNotFound")))
res.sendRedirect("./../pages/error.jsp?userAuthDispMsg=user configurations not found , Please contact admin");
else
res.sendRedirect("./../pages/login.jsp?userAuthDispMsg=UserName or password cannot be null");
else if (pageId.equals("adminPage"))
if (actionId.equals("adduser"))
CommonProperties adminProps = MTrackerProperties.getAdminProps();
CommonProperties guestProps = MTrackerProperties.getGuestProps();
String userId = req.getParameter("adduname").trim();
String password = req.getParameter("passwd").trim();
String userAuthMsg = uv.verifyUser(userId);
if (userAuthMsg.equals("adminuser"))
res.sendRedirect("./../pages/admin.jsp?userAuthDispMsg=Admin user with name exists");
else if (userAuthMsg.equals("guestuser"))
res.sendRedirect("./../pages/admin.jsp?userAuthDispMsg=Guest user with name exists");
else
String userType = req.getParameter("usertype").trim();
if (userType.equals("admin"))
adminProps.addProperty(userId, password);
res.sendRedirect("./../pages/admin.jsp?userAuthDispMsg=User " + userId + " added successfully");
else
guestProps.addProperty(userId, password);
res.sendRedirect("./../pages/admin.jsp?userAuthDispMsg=User " + userId + " added successfully");
else if (actionId.equals("deleteuser"))
CommonProperties adminProps = MTrackerProperties.getAdminProps();
CommonProperties guestProps = MTrackerProperties.getGuestProps();
String userId = req.getParameter("deluname").trim();
String userAuthMsg = uv.verifyUser(userId);
if (userAuthMsg.equals("adminuser"))
adminProps.deleteProperty(userId);
res.sendRedirect("./../pages/admin.jsp?userAuthDispMsg=Admin user " + userId + " deleted");
else if (userAuthMsg.equals("guestuser"))
guestProps.deleteProperty(userId);
res.sendRedirect("./../pages/admin.jsp?userAuthDispMsg=Guest user " + userId + " deleted");
else
res.sendRedirect("./../pages/admin.jsp?userAuthDispMsg=User " + userId + " does not exists ");
else if (actionId.equals("updatescript"))
String perlScriptLoc = req.getParameter("perlloc").trim();
SerializeProperties.doSave(perlScriptLoc);
try
Thread.sleep(2500L);
catch (InterruptedException e) {
e.printStackTrace();
res.sendRedirect("./../pages/admin.jsp?userAuthDispMsg=Perl script location updated with -> " + perlScriptLoc);
else if (actionId.equals("updatepropertyfile"))
String propfileLoc = req.getParameter("proploc").trim();
SerializeProperties.doSave(propfileLoc);
try
Thread.sleep(2500L);
catch (InterruptedException e) {
e.printStackTrace();
res.sendRedirect("./../pages/admin.jsp?userAuthDispMsg=Property file location updated with -> " + propfileLoc);
else if (actionId.equals("searchLink"))
res.sendRedirect("./../pages/search.jsp");
if (actionId.equals("cleanup"))
String resultsDir = systemProps.getProperty("results");
mTUtils.deleteFiles(new File(resultsDir), 24);
res.sendRedirect("./../pages/admin.jsp?userAuthDispMsg=Cleanup Done !!!");
else if (pageId.equals("searchPage"))
     System.out.println("Start searching process Here");
     if (actionId.equals("search"))
     System.out.println("Started searching process");
String tboxValue = req.getParameter("tbox");
String tareaValue = req.getParameter("tarea");
String SearchString = "";
String auditEnable = req.getParameter("audit");
String errorEnable = req.getParameter("error");
String debugEnable = req.getParameter("debug");
String srchStartDate = req.getParameter("srchstartDate");
String srchEndDate = req.getParameter("srchendDate");
String srchInZipFile = "";
if (req.getParameter("srchInZipFile") != null) {
srchInZipFile = req.getParameter("srchInZipFile");
String mode = req.getParameter("inputmode");
try
if (req.getParameter("recordsPerPage") != null)
noOFrecordsPerPage = new Integer(req.getParameter("recordsPerPage")).intValue();
catch (Exception e)
res.sendRedirect("./../pages/error.jsp?userAuthDispMsg=recordsPerPage should be a number");
if (mode.equals("single"))
SearchString = tboxValue;
else
SearchString = tareaValue;
String inputDir = systemProps.getProperty("inputs");
String resultsDir = systemProps.getProperty("results");
String inputFileName = new Integer(mTUtils.getRandom()).toString();
File inputParams = new File(inputDir + "/" + inputFileName + ".properties");
File inputTxt = new File(inputDir + "/" + inputFileName + ".txt");
synchronized (inputParams) {
     System.out.println("inputParams"+inputParams);
synchronized (inputTxt)
     System.out.println("inputtxt"+inputTxt);
boolean saved = false;
CommonProperties singleSerProps = new CommonProperties(inputParams);
Properties searchProps = new Properties();
searchProps.setProperty("search_from_date", srchStartDate);
searchProps.setProperty("search_to_date", srchEndDate);
searchProps.setProperty("force_zip_search", srchInZipFile);
if ((SearchProperties.saveSingeSearchProps(singleSerProps, searchProps)) && (SearchProperties.saveSearchFile(inputTxt, SearchString)))
if (mTUtils.genarateScript(auditEnable, debugEnable, errorEnable, srchInZipFile, inputFileName))
if (mTUtils.runScript("sh", inputFileName))
List tRecords = null;
TrackingLogReader treader = new TrackingLogReader();
try
tRecords = treader.getRecords(new File(resultsDir), inputFileName);
catch (Exception e)
e.printStackTrace();
if (tRecords == null)
tRecords = new ArrayList();
tRecords.add("No Records Found");
String backEnb = "";
String nextEnb = "";
int fromRec = 0;
int toRec = 0;
if (tRecords.size() > noOFrecordsPerPage)
toRec = noOFrecordsPerPage;
backEnb = "false";
nextEnb = "true";
else
toRec = tRecords.size();
backEnb = "false";
nextEnb = "false";
List subList = tRecords.subList(fromRec, toRec);
session.setAttribute("CompleteSearchRecords", tRecords);
session.setAttribute("DisplaySearchRecords", subList);
session.setAttribute("fromRec", new Integer(fromRec));
session.setAttribute("toRec", new Integer(toRec));
session.setAttribute("nextEnb", nextEnb);
session.setAttribute("backEnb", backEnb);
session.setAttribute("recsPerPage", new Integer(noOFrecordsPerPage));
res.sendRedirect("./../pages/SearchResults.jsp");
else {
res.sendRedirect("./../pages/error.jsp?userAuthDispMsg=Problem in calling PERL system , Please contact admin");
else
res.sendRedirect("./../pages/error.jsp?userAuthDispMsg=Script not generated , Please contact admin");
else
res.sendRedirect("./../pages/error.jsp?userAuthDispMsg=Search input directory not found, Please contact admin ");
//inputParams.delete();
//inputTxt.delete();
else if (pageId.equals("searchresults"))
noOFrecordsPerPage = ((Integer)session.getAttribute("recsPerPage")).intValue();
if (actionId.equals("newSearch"))
session.removeAttribute("CompleteSearchRecords");
session.removeAttribute("DisplaySearchRecords");
session.removeAttribute("fromRec");
session.removeAttribute("toRec");
session.removeAttribute("recsPerPage");
System.gc();
res.sendRedirect("./../pages/search.jsp");
else if (actionId.equals("first"))
List completeRecords = (List)session.getAttribute("CompleteSearchRecords");
int fromRec = 0;
int toRec = 0;
String backEnb = "";
String nextEnb = "";
if (completeRecords.size() > noOFrecordsPerPage)
toRec = noOFrecordsPerPage;
backEnb = "false";
nextEnb = "true";
else
toRec = completeRecords.size();
backEnb = "false";
nextEnb = "false";
List subList = completeRecords.subList(fromRec, toRec);
session.setAttribute("CompleteSearchRecords", completeRecords);
session.setAttribute("DisplaySearchRecords", subList);
session.setAttribute("fromRec", new Integer(fromRec));
session.setAttribute("toRec", new Integer(toRec));
session.setAttribute("nextEnb", nextEnb);
session.setAttribute("backEnb", backEnb);
session.setAttribute("recsPerPage", new Integer(noOFrecordsPerPage));
res.sendRedirect("./../pages/SearchResults.jsp");
else if (actionId.equals("last"))
List completeRecords = (List)session.getAttribute("CompleteSearchRecords");
int fromRec = 0;
int toRec = completeRecords.size();
String backEnb = "";
String nextEnb = "";
if (noOFrecordsPerPage > completeRecords.size())
fromRec = 0;
backEnb = "false";
nextEnb = "false";
else
fromRec = completeRecords.size() - noOFrecordsPerPage;
backEnb = "true";
nextEnb = "false";
List subList = completeRecords.subList(fromRec, toRec);
session.setAttribute("CompleteSearchRecords", completeRecords);
session.setAttribute("DisplaySearchRecords", subList);
session.setAttribute("fromRec", new Integer(fromRec));
session.setAttribute("toRec", new Integer(toRec));
session.setAttribute("nextEnb", nextEnb);
session.setAttribute("backEnb", backEnb);
session.setAttribute("recsPerPage", new Integer(noOFrecordsPerPage));
res.sendRedirect("./../pages/SearchResults.jsp");
else if (actionId.equals("back"))
List completeRecords = (List)session.getAttribute("CompleteSearchRecords");
int fromRec = ((Integer)session.getAttribute("fromRec")).intValue();
int toRec = ((Integer)session.getAttribute("toRec")).intValue();
toRec = fromRec;
if (fromRec - noOFrecordsPerPage > 0)
session.setAttribute("backEnb", "true");
fromRec -= noOFrecordsPerPage;
else
fromRec = 0;
session.setAttribute("backEnb", "false");
session.setAttribute("nextEnb", "true");
session.setAttribute("fromRec", new Integer(fromRec));
session.setAttribute("toRec", new Integer(toRec));
List subList = completeRecords.subList(fromRec, toRec);
session.setAttribute("DisplaySearchRecords", subList);
res.sendRedirect("./../pages/SearchResults.jsp");
else if (actionId.equals("next"))
List completeRecords = (List)session.getAttribute("CompleteSearchRecords");
int fromRec = ((Integer)session.getAttribute("fromRec")).intValue();
int toRec = ((Integer)session.getAttribute("toRec")).intValue();
fromRec = toRec;
if (toRec + noOFrecordsPerPage <= completeRecords.size())
session.setAttribute("nextEnb", "true");
toRec += noOFrecordsPerPage;
else
toRec = completeRecords.size();
session.setAttribute("nextEnb", "false");
session.setAttribute("backEnb", "true");
session.setAttribute("fromRec", new Integer(fromRec));
session.setAttribute("toRec", new Integer(toRec));
List subList = completeRecords.subList(fromRec, toRec);
session.setAttribute("DisplaySearchRecords", subList);
res.sendRedirect("./../pages/SearchResults.jsp");
else if (actionId.equals("download"))
String fileName = req.getParameter("fileName");
String originalFileName = req.getParameter("originalFileName");
doDownload(req, res, fileName, originalFileName);
else
res.sendRedirect("./../pages/login.jsp?userAuthDispMsg=Invalid USER");
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
doGet(req, res);
private void doDownload(HttpServletRequest req, HttpServletResponse resp, String filename, String original_filename)
throws IOException
File f = new File(filename);
int length = 0;
ServletOutputStream op = resp.getOutputStream();
ServletContext context = getServletConfig().getServletContext();
String mimetype = context.getMimeType(filename);
resp.setContentType(mimetype != null ? mimetype : "application/octet-stream");
resp.setContentLength((int)f.length());
resp.setHeader("Content-Disposition", "attachment; filename=\"" + original_filename + "\"");
byte[] bbuf = new byte[10240];
DataInputStream in = new DataInputStream(new FileInputStream(f));
while ((in != null) && ((length = in.read(bbuf)) != -1))
op.write(bbuf, 0, length);
in.close();
op.flush();
op.close();
=========================
anyone please help me on above......Thanks in advance..

Hi jleech,
Thanks for the reply. But deleting all the temporary internet files as also the history files does not seem to have an effect. the doFilter is being called only at the second request. or did i miss anything??
Please help. unable to complete the assignment because of this.
Thank You,
Phani Kanuri

Similar Messages

  • DoFilter() method is being called only at the second request

    Hi,
    I have implemented a simple Filter class
    Here is the code
    public class BasicFilter implements Filter
    FilterConfig config;
    public void init(FilterConfig config)
    System.out.println("Filter Initialised");
    this.config = config;
    public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws ServletException,
    IOException
    System.out.println("In The doFilter() method");
    ServletContext sc = config.getServletContext();
    sc.setAttribute("Hello","Hell");
    chain.doFilter(request,response);
    public void destroy()
    System.out.println("In the destroy method");
    and a simple servlet
    public class FilteredServlet extends HttpServlet
    public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("<HTML>");
    out.println("<HEAD><TITLE>Filter Demo</TITLE></HEAD>");
    out.println("<BODY>");
    out.println(getServletContext().getAttribute("Hello"));
    out.println("</BODY>");
    out.println("</HTML>");
    Now when i start the server (Tomcat 4.0) i find that the filter's init() method is being called which is fine. But when i request the servlet (FilteredServlet) the doFilter() method is not called and only when i "refresh" it or call it a second time that the doFilter() method is actually called. What could be the reason for this.
    Help will be greatly appreciated.
    Thank You,
    Phani Kanuri

    Hi jleech,
    Thanks for the reply. But deleting all the temporary internet files as also the history files does not seem to have an effect. the doFilter is being called only at the second request. or did i miss anything??
    Please help. unable to complete the assignment because of this.
    Thank You,
    Phani Kanuri

  • Why doGet() method wil be called default in servlet

    hi
    my first question is
    1.why doGet() method wil be called up first instead of doPost() method in servlet. .
    2. How to identify the browser disables the cookies.
    please help me to this questions.
    Thank u in advance.

    hi
    my first question is
    why doGet() method wil be called up first instead of
    doPost() method in servlet.This is not correct. doGet or doPost getting called depending on the request method of the HTTP request. If the request method is GET then doGet will get called, if the request method is POST then doPost will get called.
    By the way there are other request methods. If a request arrives with one of those request methods the corresponding doXXX method wil get called.
    2. How to identify the browser disables the
    cookies. There is no direct method. What you can do is set a cookie and then see if it is sent back with the next request from the same browser session.

  • Action method not being called

    Using jdev 10.1.3.4 with jsf/adf bc. I have two af:table components on a jsf page. I'll call them table A and table B. In table B, I have an input text with autosubmit=true and hooked up to a valuechangelistener. One of the columns in table B is a command button. Initially, I was having problems when the user changed the input value in table B and then immediately clicked the button in table B. Sometimes when the button was clicked, the backing bean method associated with it was not executing. Thanks to Didier's advice in this forum (Re: PPR and submit I was able to get this functionality working consistently.
    I still have a problem though. Table A has a command LINK as one of the columns, which executes a method in the backing bean when clicked. However, as in the scenario above, if the user changes a value in the input text in table B and in this case immediately clicks the LINK in table A, it seems that the action method behind the button in table A executes the first time but if user repeats steps (changes value of input in table B and immediately clicks LINK in table A) the action method is not called after the first time. For testing, there is no real code in the backing bean method. The only code in the action method is an sop so I can tell if the method was executed. Likewise, the value change listener method, for testing purposes, has a sop so I can tell if/when it is executed and the thread.sleep(400) code needed per Didier's workaround. I'll include the code from jspx:
    In the jspx -
    <afh:body firstClickPassed="true">
    <h:form>
    <!-- table A -->
    <af:table value="#{bindings.Summary.collectionModel}" var="row"
    rows="#{bindings.Summary.rangeSize}"
    first="#{bindings.Summary.rangeStart}">
    <af:column headerText="#{bindings.Summary.labels.PositionNbr}">
    <af:inputText value="#{row.PositionNbr}"/>
    </af:column>
    <af:column>
    <af:commandLink text="Click" action="#{backing_levelone_untitled2.buttonClicked}"/>
    </af:column>
    </af:table>
    <!-- Table B -->
    <af:table value="#{bindings.BdCommentsView.collectionModel}" var="row"
    rows="#{bindings.BdCommentsView.rangeSize}"
    first="#{bindings.BdCommentsView.rangeStart}">
    <af:column headerText="#{bindings.BdCommentsView.labels.CommentId}">
    <af:inputText value="#{row.CommentId}"
    required="false" />
    </af:column>
    <af:column headerText="#{bindings.BdCommentsView.labels.Comments}">
    <af:inputText value="#{row.Comments}"
    required="false" autoSubmit="true" valueChangeListener="#{backing_levelone_untitled2.isValid}"/>
    </af:column>
    <af:column>
    <af:commandButton text="Click" action="#{backing_levelone_untitled2.buttonClicked}"/>
    </af:column>
    </af:table>
    </h:form>
    </afh:body>
    I need the backing bean method behind the LINK in table A to be fired consistently, every time user makes a change to input of table B and immediately clicks LINK in table A. It works the first time, but all subsequent attempts will not result in the action method being executed. Hope someone can help.
    Edited by: user12341229 on Dec 11, 2009 3:24 PM

    I'm not sure if this is considered a bug, but I found that if I use a commandLink in table A, my code doesn't work as expected. However, I found that by using a commandButton in table A the functionality works as expected. I still would like to hear some feedback on this if anyone is interested in recreating the scenario. Thanks.

  • JSF: Method not being called

    Hi i've a problem that is grieving me. A method reference by a commandButton is not being called. Here's the code:
    JSP:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@page contentType="application/xhtml+xml"%>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <title></title>
    </head>
    <body bgcolor="white">
    <f:view>
            <f:loadBundle basename="sisard.maqueta.web.resources.ApplicationMessages" var="messages"/>
         <h:form id="newBookForm">
                <h2><h:outputText value="#{messages.welcomeMessage}" />:</h2>
                <h3><h:outputText value="#{messages.insertnewbook}" />:</h3>
                    <table>
                        <tr>
                            <td>
                                <h:outputText value="#{messages.code}" />:
                            </td>
                            <td>
                                <h:inputText id="code" value="#{GestionLibros.code}">
                                </h:inputText>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="#{messages.example}" />:
                            </td>
                            <td>
                                <h:inputText id="example" value="#{GestionLibros.example}">
                                </h:inputText>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="#{messages.title}" />:
                            </td>
                            <td>
                                <h:inputText id="title" value="#{GestionLibros.title}">
                                </h:inputText>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="#{messages.yearpublication}" />:
                            </td>
                            <td>
                                <h:inputText id="datePublication" value="#{GestionLibros.datePublication}">
                                </h:inputText>                       
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="#{messages.isbn}" />:
                            </td>
                            <td>
                                <h:inputText id="isbn" value="#{GestionLibros.isbn}">
                                </h:inputText>                       
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="#{messages.cifeditorial}" />:
                            </td>
                            <td>
                                <h:inputText id="cifeditorial" value="#{GestionLibros.cifEditorial}">
                                </h:inputText>                       
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="#{messages.nifautor}" />:
                            </td>
                            <td>
                                <h:inputText id="nifautor" value="#{GestionLibros.nifAutor}">
                                </h:inputText>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                            </td>                       
                        </tr>
                    </table>
                    <h:commandButton id="submit" action="#{GestionLibros.insertNewBook}" value="Inserir"/>               
            </h:form>
    </f:view>
    </body>
    </html>The backing bean:
    package sisard.maqueta.web.cases.case01.view;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.GregorianCalendar;
    import sisard.maqueta.sgl.model.exception.SGLException;
    import sisard.maqueta.sgs.model.exception.StockException;
    import sisard.maqueta.web.com.SGLManagedBean;
    import sisard.maqueta.web.com.ExceptionUtil;
    import sisard.maqueta.web.factory.DelegateFactory;
    public class GestionLibroManagedBean extends SGLManagedBean{
        private String code;
        private Long example;
        private String title;
        private Calendar datePublication;
        private String isbn;
        private String cifEditorial;
        private String nifAutor;
        public GestionLibroManagedBean() {
        public String insertNewBook() throws SGLException, StockException,
                                             Exception {
            DelegateFactory.getInstance().getLibroDelegate().insertarLibro(
                code,
                example,
                datePublication,
                isbn,
                title,
                cifEditorial,
                nifAutor);
                return "showBooksFound";
        public void setCode(String code) {
            this.code = code;
        public String getCode() {
            return code;
        public void setExample(Long example) {
            this.example = example;
        public Long getExample() {
            return example;
        public void setTitle(String title) {
            this.title = title;
        public String getTitle() {
            return title;
        public void setDatePublication(Date datePublication) {
            Calendar gregorianCalendar = new GregorianCalendar();
            gregorianCalendar.setTimeInMillis(datePublication.getTime());
            this.datePublication = gregorianCalendar;
        public Date getDatePublication() {
            return datePublication != null ? datePublication.getTime() : null;
        public void setIsbn(String isbn) {
            this.isbn = isbn;
        public String getIsbn() {
            return isbn;
        public void setCifEditorial(String cifEditorial) {
            this.cifEditorial = cifEditorial;
        public String getCifEditorial() {
            return cifEditorial;
        public void setNifAutor(String nifAutor) {
            this.nifAutor = nifAutor;
        public String getNifAutor() {
            return nifAutor;
    }faces-config.xml
    <?xml version="1.0" encoding="windows-1252"?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config xmlns="http://java.sun.com/JSF/Configuration">
      <!-- ##################################################### -->
      <!-- MANAGED BEANS CASO DE USO 01- LIBROS -->
      <!-- ##################################################### -->
      <managed-bean>
        <managed-bean-name>BuscarLibros</managed-bean-name>
        <managed-bean-class>sisard.maqueta.web.cases.case01.view.BuscarLibroManagedBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
      <managed-bean>
        <managed-bean-name>GestionLibros</managed-bean-name>
        <managed-bean-class>sisard.maqueta.web.cases.case01.view.GestionLibroManagedBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
        <!-- ######################################## -->
        <!-- NAVIGATION RULES CASO DE USO A01-DATOS ADMINISTRATIVOS DE USUARIO -->
        <!-- ####################################################### -->
        <navigation-rule>
            <from-view-id>/searchBooks.jsp</from-view-id>
            <navigation-case>
                <from-outcome>showBooksFound</from-outcome>
                <to-view-id>/searchBooks.jsp</to-view-id>
            </navigation-case>
            <navigation-case>
                <from-outcome>insertNewBook</from-outcome>
                <to-view-id>/insertNewBook.jsp</to-view-id>
            </navigation-case>       
        </navigation-rule>
        <navigation-rule>
            <from-view-id>/insertNewBook.jsp</from-view-id>
            <navigation-case>
                <from-outcome>showBooksFound</from-outcome>
                <to-view-id>/searchBooks.jsp</to-view-id>
            </navigation-case>
        </navigation-rule>   
    </faces-config>Thanks in advance.

    Thanks for your reply. The problem was with Date datePublicacion. It was missing a converter.
    java.util.Date is deprecated. Is there a chance to use java.util.Calendar?

  • In Pre-Exit, prevent method from being called

    I have created an enhancment for a webdynpro component. Then, I have defined a pre-exit for a method in the component controller. Inside the pre-exit, I do a couple of checks, and depending on them, I would like to skip the processing of the method for which I have define the pre-exit. Is this possible?
    I thought of the RETURN statement, but this won't help. RETURN will jump out of the pre-exit, but not out of the method.
    my-pre-exit-of-method-SET_MY_VALUE.
      IF some_condition = some_value.
        "prevent the method SET_MY_VALUE from being called. but how??
      ENDIF.
    end-of-pre-exit.

    I just find out how to circumvent this...
    The trick is to use "Overwrite exit".  Add your own codes.  Depending on your conditions, you can call back the original method.  But when you call the original method, you need to use the syntax:
    me->original_method(...)
    Do not use:
    wd_this->original_method(...)
    Using "me" will only call the original method; using "wd_this" will trigger your overwrite exit which means this will jump to a recursive call to your own exit; This will certainly drain the resources of your system indefinitely until it dumps.
    Brian H.

  • In Pre-Exit, pervent method from being called

    I have created an enhancment for a webdynpro component. Then, I have defined a pre-exit for a method in the component controller. Inside the pre-exit, I do a couple of checks, and depending on them, I would like to skip the processing of the method for which I have define the pre-exit. Is this possible?
    I thought of the RETURN statement, but this won't help. RETURN will jump out of the pre-exit, but not out of the method.
    my-pre-exit-of-method-SET_MY_VALUE.
      IF some_condition = some_value.
        "prevent the method SET_MY_VALUE from being called. but how??
      ENDIF.
    end-of-pre-exit.

    this is probably not possible. i have to close this message because i can not have more than 10 open questions anyway.

  • JSF 1.2 Rendered decode method not being called

    I've been banging my head about this one, I have a custom component with:
    TagClass
    RendererClass
    ComponentClass
    The encodeBegin is running fine in the renderer class, but the decode method is never being called - and it does properly over ride the super class method:
    public class UIRendererClass extends Renderer {
    public void decode(FacesContext context, UIComponent component) {
    // Do some stuff
    The output always renders correctly - but it never calls the decode method (which updates some other page components), proved with logging and forced exceptions.
    I'm using SJAS 9.0 FCS and Facelets 1.1.11, anybody any ideas?

    Hi,
    I can't use my own components with JSF 1.2 and facelets and Tomcat 5.0.28, so I will be very grateful if you can send to a small working example (i.e. project) of using custom components.
    Thanks in advance

  • How to stop the std SUS method from being called

    Hi
    I am working on SRM - EDI integration for NON SUS vendor.I am using a custom mapping and custom method call in this case.i have placed the logic in the std. mapping BADI - BBP_SAPXML1_OUT_BADI.i am triggering my custom method call in this method only.but i am unable to stop the control flow here after as i need not to trigger the Std. process.
    Regards,
    Durgaprasad Kare.

    Hi Durga,
    The BADI BBP_SAPXML1_OUT_BADI is meant for mapping purposes in the outbound proxy object and cannot be used to control the message flow.
    What I would suggest you to code the custom logic in the BBP_DOC_SAVE_BADI where is you can check the vendor and determine the custom message needs to be trigerred. Besides you have a check at XI level to block those mesages that are not needed.
    Regards
    Kathirvel

  • Which method is being called?

    Hi,
    I have the foll. setup:
    class A{
    func1();
    func2(){
    func1();
    class B extends A{
    func1(); // over-ridden
    super.func2();
    So, when super.func2() is called, and A.func2() is executed, within it does A.func1() get called or does B.func1() get called. If A's method gets called how can I change it to call B's method instead?
    Thanks.

    Write up a quick test case. You can easily find this out for yourself.

  • Inheritance: Keeping a supers method from being called

    Lets say I have the following situation:
    public class SuperClass
        public void methodOne(){/* Do Stuff */}
        public void methodTwo(){/* Do Stuff */}
    public class FooBar extends SuperClass
        public void methodThree(){/* Do Stuff */}
    }My question is, is there any tidy way of making it so that the programmer can't do something like the following:
    FooBar fooBar = new FooBar();
    fooBar.methodOne();In other words, I want to basically disable the programmer from being able to call FooBars methodOne() that was derived from its super class.
    Thank you for your time,
    Brandon Murphy

    Make it private.
    If it needs to be public then I have to wonder if the child class is a true child class as you desire that it shouldn't have all of the public behaviors of the parent. Perhaps you will need to extend by composition rather than by inheritance.
    Edited by: Encephalopathic on Jun 5, 2010 3:04 PM

  • On Execute operation, the bean getter is being called multiple times

    Hi,
    I have a JCR data control, i am trying to write a method that returns predicate, but this method is being called multiple times, when executing the advanced search operation.
      public List<Predicate> getPredicates() {
      ArrayList<Predicate> predicates = new ArrayList<Predicate>();
       // predicates.add(new Predicate("jcr:content/idc:metadata/idc:xScope",Operator.EQUALS,"GLOBAL"));
      DCBindingContainer bc=(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
      JUCtrlListBinding attrBinding=(JUCtrlListBinding)  bc.findCtrlBinding("StateId");
      Object stateId= attrBinding.getSelectedValue();
      if(stateId instanceof Row){
      predicates.add(new Predicate("jcr:content/idc:metadata/idc:xState"
      , Operator.EQUALS
      ,((Row)stateId).getAttribute("StateId").toString()));
      attrBinding=(JUCtrlListBinding)  bc.findCtrlBinding("DistrictId");
      Object districtId=attrBinding.getSelectedValue();
      if(districtId instanceof Row){
          predicates.add(new Predicate("jcr:content/idc:metadata/idc:xDistrict",Operator.EQUALS,((Row)districtId).getAttribute("DistrictId").toString()));
        attrBinding=(JUCtrlListBinding)  bc.findCtrlBinding("Scope");
        Object scopeId=attrBinding.getSelectedValue();
        if(scopeId instanceof Row){
            predicates.add(new Predicate("jcr:content/idc:metadata/idc:xScope",Operator.EQUALS,((Row)scopeId).getAttribute("ScopeType")));
        AttributeBinding tempAttrBinding=(AttributeBinding)bc.findCtrlBinding("CreatedDate");
        Object createdDate=tempAttrBinding.getInputValue();
        if(createdDate!=null){
            predicates.add(new Predicate("jcr:content/jcr:created",Operator.EQUALS,createdDate.toString()));
        if (predicates.size()>0){
          return predicates;
      return Collections.emptyList();
      } The problem is while it's being called multiple times different list's are being returned which is causing the method not to work . The bean is in pageFlowScope .

    That is bc ADF life cicle... Is always executing 2 times...

  • Set methods aren't called

    For some of my managed beans, the set methods are not being called for the properties. Instead, it appears that the get methods are being called, and it modifies the reference in order to modify the stored property. I am using Facelets 1.1.12, MyFaces 1.1.4, and tomcat 5.5.17 (the one bundled with netbeans). The bean is a Spring managed being, which JSF accesses through Spring's DelegatingVariableResolver.

    I have a Java object which has a field which references another object. On my jsf page, I have:
    <h:inputText value="#{myBean.innerObj.val}" />When the form is submitted, the setVal method in innerObj is called, but the setInnerObj method in myBean is not called. Instead, it calls getInnerObj and probably uses the reference to modify the object.

  • Finalize() method being called multiple times for same object?

    I got a dilly of a pickle here.
    Looks like according to the Tomcat output log file that the finalize method of class User is being called MANY more times than is being constructed.
    Here is the User class:
    package com.db.multi;
    import java.io.*;
    import com.db.ui.*;
    import java.util.*;
    * @author DBriscoe
    public class User implements Serializable {
        private String userName = null;
        private int score = 0;
        private SocketImage img = null;
        private boolean gflag = false;
        private Calendar timeStamp = Calendar.getInstance();
        private static int counter = 0;
        /** Creates a new instance of User */
        public User() { counter++;     
        public User(String userName) {
            this.userName = userName;
            counter++;
        public void setGflag(boolean gflag) {
            this.gflag = gflag;
        public boolean getGflag() {
            return gflag;
        public void setScore(int score) {
            this.score = score;
        public int getScore() {
            return score;
        public void setUserName(String userName) {
            this.userName = userName;
        public String getUserName() {
            return userName;
        public void setImage(SocketImage img) {
            this.img = img;
        public SocketImage getImage() {
            return img;
        public void setTimeStamp(Calendar c) {
            this.timeStamp = c;
        public Calendar getTimeStamp() {
            return this.timeStamp;
        public boolean equals(Object obj) {
            try {
                if (obj instanceof User) {
                    User comp = (User)obj;
                    return comp.getUserName().equals(userName);
                } else {
                    return false;
            } catch (NullPointerException npe) {
                return false;
        public void finalize() {
            if (userName != null && !userName.startsWith("OUTOFDATE"))
                System.out.println("User " + userName + " destroyed. " + counter);
        }As you can see...
    Every time a User object is created, a static counter variable is incremented and then when an object is destroyed it appends the current value of that static member to the Tomcat log file (via System.out.println being executed on server side).
    Below is the log file from an example run in my webapp.
    Dustin
    User Queue Empty, Adding User: com.db.multi.User@1a5af9f
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    Joe
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin pulled from Queue, Game created: Joe
    User Already Placed: Dustin with Joe
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    INSIDE METHOD: false
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    User Dustin destroyed. 9
    User Joe destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    It really does seem to me like finalize is being called multiple times for the same object.
    That number should incremement for every instantiated User, and finalize can only be called once for each User object.
    I thought this was impossible?
    Any help is appreciated!

    Thanks...
    I am already thinking of ideas to limit the number of threads.
    Unfortunately there are two threads of execution in the servlet handler, one handles requests and the other parses the collection of User objects to check for out of date timestamps, and then eliminates them if they are out of date.
    The collection parsing thread is currently a javax.swing.Timer thread (Bad design I know...) so I believe that I can routinely check for timestamps in another way and fix that problem.
    Just found out too that Tomcat was throwing me a ConcurrentModificationException as well, which may help explain the slew of mysterious behavior from my servlet!
    The Timer thread has to go. I got to think of a better way to routinely weed out User objects from the collection.
    Or perhaps, maybe I can attempt to make it thread safe???
    Eg. make my User collection volatile?
    Any opinions on the best approach are well appreciated.

  • How to find the number of times method being called.....

    hi,
    can any one pls tell me how to find the number of times the method being called......herez the example....
    Refrence ref = new Refrence();
    for(int i = 0;i < arr.length; i++){
    if(somecondition){
    ref.getMethod();
    here i want to know how many times the getMethod() is calling...Is there any method to do this.. i have seen StrackTraceElement class..but not sure about that....pls tell me the solution....

    can any one pls tell me how to find the number of times the method being called......
    herez the example.... http://www.catb.org/~esr/faqs/smart-questions.html#writewell
    How To Ask Questions The Smart Way
    Eric Steven Raymond
    Rick Moen
    Write in clear, grammatical, correctly-spelled language
    We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway). Answering questions for careless and sloppy thinkers is not rewarding; we'd rather spend our time elsewhere.
    So expressing your question clearly and well is important. If you can't be bothered to do that, we can't be bothered to pay attention. Spend the extra effort to polish your language. It doesn't have to be stiff or formal ? in fact, hacker culture values informal, slangy and humorous language used with precision. But it has to be precise; there has to be some indication that you're thinking and paying attention.
    Spell, punctuate, and capitalize correctly. Don't confuse "its" with "it's", "loose" with "lose", or "discrete" with "discreet". Don't TYPE IN ALL CAPS; this is read as shouting and considered rude. (All-smalls is only slightly less annoying, as it's difficult to read. Alan Cox can get away with it, but you can't.)
    More generally, if you write like a semi-literate b o o b you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like a semi-literate b o o b to save two entire keystrokes.

Maybe you are looking for

  • Java Panel not working

    We have BO XI R2.  When I try to create a new webi document, and after I select a universe, Infoview tries to install java each time.  I have java 1.4.04 (which it tries to install) on my system.  I have even let it uninstall java and reinstall it, b

  • When i open my Safari, it closes after 5 seconds.

    I have installed a toolbar, which i think is the problem, but it closes before i'm able to remove it.. When it closes it says something like "Safari suddenly closed while using the ct_plugins-pluginmodule" but to me its in norwegian so its probably n

  • 5230 - a few simple questions

    Hi, I've been looking at buying the Nokia 5230 and I've got a few questions I wouldn't mind some help with. Mainly to do with the sat nav function. 1. Is SAT NAV built into the phone. In other words, can I turn my phone on sit in my car and use it as

  • When I click on firefox setup 11.o nothing happens

    when i click on firefox setup 11.0 nothing happens

  • Adobe Premiere Elements 7 Errors

    When I burn a DVD, I get an reptitive error relating to file VideoSegmentsImpl.cpp-110 and the music that is installed on the menu screen does not play. I reinstalled completely...no help. Any ideas?