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
Similar Messages
-
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 -
Function in select statement need to be called only for the last record.
Select state,
local,
fun_state_loc_other_details(19) details
from state_local
where pm_key=19
resuts:_
State Local Details
AP APlocal details1
UP UPLocal details1
MP MPLocal details1
i) The above query returns 100 records
ii) fun_state_loc_other_details is also getting called 100 times. But I want this function to be called only for the last record that is 100th record.
is there any way to do that?Thanks amatu.
One more small query. Can I do it on condition based.
Select state,
local,
fun_state_loc_other_details(19) details
from state_local
where pm_key=19
Like if one state it need to be called once.
AP -- 50 records
UP - 20 records
MP -- 10 records.
fyi: this record no. varies
I want the function to be called for AP once, UP once, MP once. -
Can't figure, looking at the code in an .html file what templa
te is being called or where the templa
te is.Hi,
please have a look to http://forums.adobe.com/message/3407051#3407051, point 4, where Murray explained "tool template".
Good luck!
Hans-G. -
iframe link to #anchor only works the second time
I am exploring a way of delivering a local HTML file into a Web Content frame in such a way that it starts at a specific HTML anchor rather than the top of the HTML page.
Now, since DPS's Web Content overlay does not support the URL+anchor string format (e.g. myfile.html#myanchor), I thought I might achieve the desired result by loading a little HTML file into the Web Content overlay that points to the intended HTML file and its named anchor in an <iframe> tag.
Here's where it gets annoying. The solution works... but only on the second and subsequent times you call up the Web Content overlay (normally hidden in a MSO).
The first time I call up the Web Content overlay in my DPS article on the iPad, however, the HTML page displays but not at the specificed anchor point, nor indeed at the top of the HTML page - instead, it seems to start a little bit further down from the anchor. If I dismiss the Web Content overlay (in my case, switch to a different Object State) and return to it, the HTML reloads starting at anchor position, exactly as intended. I can close the folio, re-open it and still the behaviour is correct. It was only the first time that it fails to do the right thing.
I am very happy that my solution works on the second, third and all subsequent occasions, but it's pretty important that readers see it working first time.
I have tried delaying the autoplay of the Web Content but this does not make any difference. The anchor is designated using the 'id' tag.
Any ideas?Thanks, Neil. But you can ask your guys to stand down. Someone got me a strong coffee this evening and I realised I was tackling this from the wrong angle. I have since seen this issue of HTML pages requiring a refresh before displaying correctly in other circumstances, even in Chrome on my computer, so I doubt it is a specific DPS problem - possibly it's something in webkit.
Anyway, the coffee made me realise that I don't need an iframe to load another HTML file at an anchor. All I need is to pop a little GoToAnchor script in the <head> tag and a call at the beginning of the <body> tag.
One day, if someone fixes Adobe's utterly broken Cookbooks site, I'll upload a bunch of these recipes. -
SKYPE call only about 30 seconds, over time it wil...
4G network in Canada using SKYPE call the Chinese mainland's number on Android phones, each call only about 30 seconds, after 30 seconds will automatically hang up, but the use of IPAD wifi using SKYPE In this case the situation is no , what is the problem? ?
1. Close all inactive apps in the Task Bar. Double-click the Home button and hold apps down for a second or two. Tap the minus sign to close app.
2. Hold the Sleep and Home button down for about 10 seconds until you see the Apple Logo. -
When receiving an call waiting can't push the hold and answer button.Because: it will put on hold the first caller, answer to the second, but you can't hear the second until you end the first call !!! Anyone has the same problem ? Did anyone know why ?
Contact iTunes Customer Service and request assistance
Use this Link > Apple Support iTunes Store Contact -
Add a watermark logo only on the second copy
Hi there , I got an invoice smartform that need to be printed in 2 different copies and only in the second i need to put a watermark logo with the "COPY" writing beside... how can I do this ??
than youok thanks for this (i already know it) but how I have to create the graphic ??
I mean I create an image with the COPY writing but if I create the graphic element on the page's window of the SF the writing COVER all the other elements -
Button action only from the second click on
Hello, everybody!
I´m facing a weird problem on my application. I have a button that
takes action only from the second click on. My vi has several buttons,
all of them have the same type, and all of them work properly(since the
first click) except one.
I gave up a few minutes ago...any ideas?
Thank you,
LuannaHi
Well this sounds quite strange. The best way to help you is to comment your vi. I think a picture is not enough, as we have to see the behaviour.
So - is it possible for you to post the vi here?
Using LV8.0
Don't be afraid to rate a good answer... -
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 PMI'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.
-
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. -
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, 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 -
Cisco Cube outgoing calls only display the sip-ua number
Hi all,
just configure a cisco cube. Incoming and outgoing calls working fine till now.
Just facing an issue by outgoing calls. Any call will display the sip-ua registered number.
Is there any possibility to send the invite with the calling extension number to the provider ?
Trace:
Sent:
INVITE sip:XXXXXX0705430@REGISTRAR:5060 SIP/2.0
Via: SIP/2.0/UDP IPADR:5060;branch=z9hG4bK1A26DC42
From: <sip:XXXXX8650@REGISTRAR>;tag=610A3424-23E3
To: <sip:XXXXXX0705430@REGISTRAR>
Date: Tue, 01 Apr 2014 13:06:20 GMT
Call-ID: 407F52E0-B8D511E3-AFC2A60F-9EF8485@IPADR
Supported: 100rel,timer,resource-priority,replaces,sdp-anat
Min-SE: 1800
Cisco-Guid: 1082006160-3100971491-2948376079-0166691973
User-Agent: Cisco-SIPGateway/IOS-15.2.4.M4
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER
CSeq: 102 INVITE
Timestamp: 1396357580
Contact: <sip:XXXX8650@IPADR:5060>
Expires: 180
Allow-Events: telephone-event
Proxy-Authorization: Digest
username="XXXXX656",realm="sipserver",uri="sip:CALLED NUMBER@REGISTRAR:5060",response="76585ce198a4e979b49506b0ea6c515e",nonce="533abaa600015524028af19f6845968088c38fe616a3cdba",algorithm=md5
This number will the called party see on the phone screen ->
Max-Forwards: 69
P-Preferred-Identity: "Test NextiraO" <sip:XXXXX8650@IPADR>
Session-Expires: 1800;refresher=uac
Content-Type: application/sdp
Content-Disposition: session;handling=required
Content-Length: 253
Any hint?!
Thanks
StefanDuplicate posts.
Go here: http://supportforums.cisco.com/discussion/12160936/cisco-cube-outgoing-calls-only-display-sip-ua-number
Maybe you are looking for
-
No goods receipt possible for PO with confirmation
Hello gurus, My standard PO has to be confirmed according to feed back from vendor. Then in confirmation tab, I selected the standard confirmation control "confirmations". The GR is then not possible, which is the standard behaviour. Now I got back t
-
I was in the process of running various diagnostics from the HP Mr. Fixit when a blue-bordered message from HP came up on my monitor that says "Input not supported". Everything seems to be running OK but I can't get rid of the message, which continu
-
If I am viewing a fact table (25 Million+ records) from SE11 is there anyway that I can easily check how often a value for one of the dimensions (columns) repeats itself. If there is another method to do the same could you advise. Thanks
-
Regarading IDOC status 26 ,syntax error
Hi All, we have some problem to create IDOC type ORDERS05 for Purchase Order. *ERROR STATUS 26:* (SYNTAX ERROR IN IDOC (SEGMENT CANT B IDENTIFIED)) msg number E0078: The segment E1EDK14 does not occur at the current level of the basic type ORDERS05 (
-
Conflicts Warehouse Builder vs JDevelopper
Hello I have installed database Rel. 2. JDevelopper 9.0.3.2 with BI Beans 9.0.3.6. Additionally I installed the warehouse builder 9.2.0.2.8. Since I did this I receive the following error message by starting JDevelopper: WARNING: Cannot find default