Skip to main content

Posts

Set url pattern to catch all urls like /messages?inbox or /list?orders

i am new to java and i have faced to very strange problem with url mapping... i have to write a url pattern to catch the urls like: XX/../list?inbox ../action?SomeAction .. - means anything. i need such a configuration in my web.xml file, somewhere near: <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>*.htm</url-pattern> <url-pattern>*.ajax</url-pattern> <url-pattern>*.do</url-pattern> </servlet-mapping>

Fields are cleared but just when I press F5

I don't know if it is a common problem, but this strange problem is giving me some headache... I'm having an strange behavior, my application has a lot of dialogs, and when user opens one, the dialog should show default content. The problem is that I clear all bean's properties before show the dialog, but sometimes it appears that the form isn't cleared!! For example, this is one of the dialogs that are having this problem: This image show how the dialog appears the first time I open it, all fields are cleared and the second radio is selected. If I change the radio selection and enter something in the input field, the datatable immediately shows the data accordingly with the search. So, if I click in "Cancelar" (cancel in portuguese), this dialog is closed, like expected. Then I open this dialog again and: The fields store the last edition user made. I thought I wasn't clearing the bean, but if I just press F5 (refresh) the dialog is shown like i

disable form action redirect when using curl to load a page

Could someone give me an idea on how not to redirect the page when using cUrl. I mean, i got this code: $url = "http://somesite.com/submit.php?name=" . $email . "&email=" . $email; $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, false); $curl_output = curl_exec ($ch); curl_close ($ch); echo "Hello!"; What happens is that inside the submit.php there is a form that autosubmits using javascript. the submit.php does not continue since it will redirect to the form's action page. What curl options should I add on the code to make submit.php continue without the form action taking over the page and run the rest of the code of submit.php ? submit.php <?php $name = $_GET['name']; $email = $_GET['email']; ?> <form method="post" action="actionpage.php" name="myform"> .... </form> <script type="text/javascript" lan

Cache (static) content from other website on my own webserver

My website is loading slowly and I ran this test: http://www.webpagetest.org/result/120227_MD_3CQZM/1/performance_optimization/ Which indicates that files stored on gametrackers.com is not being cached. Apache and joomla already cache content that is on my server. I'm using a script from gametrackers.com to show my teamspeak 3 statistics on my website 1 However this script sometimes loads slowly duo to issues with gametrackers.com server and that's why I'd like to store a copy of it on my own webserver as cache and refresh it every 30 minutes from the gametrackers website. If the gametrackers website is down(which is quite common) it should keep the last successful cache check. How would I do this with apache 2.4.1 and possibly php? If its possible I'd also like to use css sprites because webpagetest.org indicates: The following images served from gametracker.com should be combined into as few images as possible using CSS sprites. http://cache.www.gametrack

PHP For Each Download File

I'm either using incorrect syntax or going about this with the wrong method. In the html document that references this php file, there is a simple list of checkboxes. The user checkmarks the boxes and hits submit. This then kicks off with the goal of prompting the user to run or save each file. If I checkmark test1.txt, test2.txt and test3.txt, there should be a popup for each (assuming of course the browser is IE). The issue is that only the 'last' checkmarked item is downloaded - the rest are not. I thought of opening a popup window for each file found but it has no effect. If I use echo $filename, it then correctly displays each entry I checkmarked so the php script appears to be given the multiple file names correctly. Can someone point me in the right direction? I'm pretty sure the $filename in the window.open parameter is not being used in the right syntax right now too. Here is the script: <?php foreach($_POST['files'] as $filename) { echo &quo

JAVA Exception in main thread java.lang.NoDefFounderror: net/&hellip;/AbstractClock

I have a clock program as AbstractClock.java in C:\Users\Neeraj\Prg folder . CLASSPATH is specified as C:\Users\Neeraj\Prg COMPILED javac AbstractClock.java with no errors. RUN AS java -cp . net.sf.fmj.ejmf.toolkit.media.AbstractClock Getting errors as Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/fmj/ejmf/toolkit/media/AbstractClock Caused by: java.lang.ClassNotFoundException: net/sf/fmj/ejmf/toolkit/media/AbstractClock at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:315) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) Could not find the main class: com.hib.TranslateSQL. Program will exit. PRO

RichFaces Column: Saving value of attribute on a row for comparisons

Hello I'm developing a Web Application using RichFaces 3. I have a rich:dataTable with individual rich:column . One of these columns has a Date value and there is this requirement where if the date is the same on consecutive rows the value has to be shown only on the first row, subsequent rows with same value will show nothing. So I need to save the date value for comparison on subsequent rows. Does anybody know how to do this with richFaces?