Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!

reubin haz

Ranch Hand
+ Follow
since May 12, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by reubin haz

Can someone please give some advice? I created a topic messages on 'topic.Example' that expired in 30 seconds, but the server do not send a message automatically to subscriber that listens on 'ActiveMQ.Advisory.Expired.topic.Example'. Am I doing wrong somewhere or is this just how ActiveMQ behave?

Do I have to reply on Java to count expiration time to do something upon expiration?

Thanks.
I'm trying to get familiar with ActiveMQ topic. I created a publisher and subscriber, with topic that expires in 30 seconds

Here is the code for publisher:




See the last a few lines, I have made the topic "topic.Example" be persistent and called setTimeToLive(). Although a subscriber cannot receive a message that created longer than 30 seconds. I don't see ActiveMQ server admin automatically shows the expired topic "ActiveMQ.Advisory.Expired.topic.Example". Then how do I let subscriber know a topic message is expired and do something accordingly?

BTW, in the ActiveMQ server admin, all the topic's 'Messages Enqueued' column values are always ever incremented. Does this mean memory keep all messages around? Where and how do I setup its limit?

Thanks.
Yes, I have that in the wrapper page.
Actually I have other pages working for the content that contains #{msgs.key} inside content. But it's not working for the key as part of <ui:define name="content"> itself as I stated above. So I was wondering if facelet itself would have some problem?
7 years ago
JSF
Here is the code for the locale class



The code is working for the header portion, not the content portion which is below it and specified by
<ui:define name="content">
<ui:include src="#{msgs.glossaryLink}"/>
</ui:define>

where #{msgs.glossaryLink} is either glossaryLink=/template/static/glossary/glossary.html or glossaryLink=/template/static_fr/glossary/glossary.html

Thanks
7 years ago
JSF
I have a web app built by JSF2, with English and French versions of pages.
I created a wrapper.xhtml as the template page, defined header, content, and footer pages

Then I created a helper page that uses this wrapper as the template.


'msgs.glossaryLink' contains the links for helper pages for English and French, which points to 2 different pages in different path

If I clicks from other page to come to this help page, it's loaded fine. But when I clicks the link for switching language link (in the header) in this helper page alone, the content portion, which is the file for English or French, is loaded one step behind, or I have to refresh the page in order for the content to match the header's locale.

Does this mean I cannot do internationlization in the facelet itself, or what's wrong with this behavior?

Thanks.
7 years ago
JSF
thanks for the discussion. It looks like I have to write a custom filter now.
7 years ago
JSF
Thanks Tim for the light up.

I had some thought about my tomcat configuration. The most possible scenario might come from this: my tomcat web.xml has the default 30 mins time out. But my project web.xml has 20 mins. So would this leave 10 mins gap that the project is timed out but tomcat still remember last accessed page and something else?

I had a test between 20 mins and 30 mins to click some page, but once I login again, I thought tomcat would redirect to my last accessed page but it goes to the welcome page defined in my project web.xml.

This happens rarely and I cannot reproduce this bug the client reported, which makes me hard to know where exactly to fix it and test it.
7 years ago
JSF
I think I originally posted this thread in tomcat topic, but some moderate moved it to here...
I think it's from some tomcat mechanism but I couldn't find much documentation about this feature.
7 years ago
JSF
I'm using tomcat 6 and jsf to build a web app. When a page is timed out, and the user login again, it would not go to the index page but the last accessed page. But I want it always go to the index page first. How do I disable this?

I'm not sure where exactly is this configured or implemented. Can someone give me some clue?

Thanks.
7 years ago
JSF
Thanks Tim.

I often use javascript to enforce some change on html, rather that to use some third party framework. I know it's not always the best way to do, but I think it's also not uncommon to have business logic, or control, in javascript in many populate websites.

I looked into richfaces and icefaces. I found a good example for icefaces (http://component-showcase.icefaces.org/component-showcase/showcase.iface). Then I used icefaces-2.0.0-Beta-1 to integrated with my jsf 2 code.

But the page does not show up any html for icefaces tags, when I use firebug to look at them, the code are there, but its in grey color, looks like been hidden, and I found some code being inserted:



It looks like been added by icefaces. But why the <ice:menuBar>, <ice:menuItem> tags are not displayed at all?
7 years ago
JSF
I'm using JSF 2 to dynamically generate some
    and
  • tags, and use the tool, 'Smooth Navigational Menu' at http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm to display a cascading dropdown menu.

    After the page loads up, the dropdown doesn't behave correctly. When I look at the source code, it is <ul> and <li> instead of
      and
    • which is why the javascript code failed to build up the rich menu.

      Does anyone one know how should I solve this problem? Thanks.
7 years ago
JSF
I'm using JSF 2 to create a web app with internationalization, with a switch link between English and French. When the page is in English, the page will have a French link; when the page is in French, it will have a English link. But when the page language gets switched, the link is not refreshed, till I refresh the page.

I looked at some posts saying, to implements PhaseListener, but it need import javax.el.ValueExpression; which is from servlet-api.jar. If I include this jar in my lib folder, I will get error 'java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory'

I googled this error, it says its caused by the conflict. Tomcat has already had this jar, I then checked server lib folder, it is there, but how could my Java class reference to there?? If I remove jsp-api.jar from my own lib directory, it's a compilation error, if I ignore it and still build war file and deploy it, its still failed to start the application as error now is 'INFO: validateJarFile(/usr/local/apache-tomcat-6.0.26/webapps/my_project/WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

Please help, thanks.
7 years ago
JSF
I used spring security to do authentication and authorization, alone with some common filters, like authenticationProcessingFilter, and with value setup in the spring security configuration file, like '/' for defaultTargetUrl, '/j_spring_security_check' for filterProcessesUrl. But I would like to provide a url that can be accessed by the third party that is directly accessed from the outside, which means the user from the third party has no need to do authentication again and I need convert some value from there match roles in my application.

If I create another filter to handle this access request from the third party, then how could I setup properly to allow this access bypassing login page? Or, when a user login normally from login page, how to prevent this user not going through filter that does process users from the third party?

I only know I could create a chain of filters in the bean filterChainProxy. But how to setup an alternate filter, or is it possible to run filter based on some condition?
7 years ago
I'm using tomcat, JSF 1.1 and javascript to build a web app. I found that after logging out, the user can click back button and view the page content inside. Although I have tried a few different ways. It seems none of them are working so far.

First, I tried to place some jsp generated session value passing into javascript function in onload event. I thought once it's logged out, the session value passing into javascript function will become null, but it turns out that when the user use back button to view it, the browser displays cached content instead of going through server side. I even placed meta tags with 'no-cache' values, but its still not working.

Second, I tried to use javascript to get urls in history object and see the logout page has been visited, then I know it has been logged out before. But 'window.history.next' in ie is always getting value of undefined; in firefox, its even not allowed to access history object for security reason.

I see yahoo and hotmail emaill account can do the trick to prevent back button to see the previous page content. How should I implement this?
Thanks.
thanks for the reply.
But for my scenario, my firstTimeLogic() is actually the constructor of my back bean class, which is supposed to be called from JSF container when the page is loaded. So I cannot really instantiate my back bean class inside firstTimeLogic() method...
8 years ago
JSF