Categories
Computing Web Development

Weird Firefox 3 Issue

So I succumbed to the urge an installed Firefox 3 on my home machine. Most extensions are there now, except for my beloved TinyURL Creator, so things are pretty cool. That, except for the weird icon that I have appearing above the File menu (and cannot appear to be removed) that looks like this:

firefox-3-weird

What is FF FD? Any ideas?!

UPDATE:

I believe I have a solution to the issue. One of my add-ons/extensions was apparently not compatible with Firefox 3 (and I *did* tinker with it being a bit of a hopeful thinker – ‘How bad can it be?’) or that have a conflict with other extensions (sounds very Mac OS 9…). In any case, if this happens to you, the procedure to detect the offending extension is pretty simple:

  1. Go to the ‘Tools’ menu and select ‘Add-ons’.
  2. Click the ‘Extensions’ button which will list all available extensions.
  3. One by one, disable all of them. Extensions should have a ‘Disable’ button available when you click them in the extension list. Although you will be prompted to restart Firefox after you disable the first one, you can disable all of them and only then restart.
  4. Restart Firefox. It will most like take a bit of time, but it will start and I will be that you will not see the pesky FF FD icons anymore.
  5. Now, one by one, or two by two (whatever) re-enable the extensions. You will eventually get the FF FD back there, but by this method of deduction you will get to know precisely which is the offending extension (the last one you enabled!).

Hope this is of help.

Share
Categories
Computing Java Web Development WebSphere

Setting up Spring MVC welcome page without rewrites or redirection

So you have a Spring MVC web application and want to make sure that when the user enters a URL such as
http://www.myawesomedomain.com he/she will see the home page of your application. How do you get Spring MVC’s RequestDispatcher servlet, which acts as the traffic cop and then some for your web application, to act as the default URL handler in the eyes of the web application? There are two good ways to do it, and two bad ones. Let’s start with the bad ones, of course:

  • Redirect through meta tag: you add a meta-refresh element to the head element which causes the browser showing the page to go the ‘real’ home page url, such as /index.do
  • You use JavaScript to force the page to redirect – this will also work but forces you to rely on client-side processes to get stuff done. For example: window.location="index.do" inside an index.html file.

Both are sub-prime because search engines are not too keen to follow such redirects, often time avoiding JavaScript altogether.

So what are the good ways:

  • Using Apache’s mod-rewrite to mask the URL of your application, but that assumes you have a web server in front of your application
  • Using the servlet API – which is what you read below

So how do you do it?

  1. In the application’s web.xml file map the RequestDispatcher servlet to handle requests for index.htm, aside from handling the extension of your liking, say, *.do. You do this through the servlet-mapping element. This should look like this:

    <servlet -mapping>
        </servlet><servlet -name>requestDispatcher</servlet>
        <url -pattern>*.do</url>
     </servlet -mapping>
      <servlet -mapping>
        </servlet><servlet -name>requestDispatcher</servlet>
        <url -pattern>/index.htm</url>
     </servlet -mapping>  
    
  2. Also in web.xml, set up a welcome file that may be requested by a browser when a user does not enter a specific page request, e.g. www.domain.com. Most browsers at a minimum will automatically request, on behalf of the user, index.html and index.htm.

So choose one, say index.htm and set the <welcome-file> element to look something like this:

<welcome-file-list>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>

This will make your application by default make requests for ‘/’ go to index.htm.

  • The last and final step is to map the url index.htm to the controller for the application’s home page. You do this in a Spring MVC beans xml file when specifying the URL mapper.
    For example:

    <bean id="unAuthenticatedUrlMapping"
            class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
          <props>
            <prop key="/index.do">homePageController</prop>
            <prop key="/index.htm">homePageController</prop>
          </props>
        </property>
      </bean>
    

    This way the RequestDispatcher will know which control is actually going to load the information that will be displayed by the view for the home page.

  • And that’s it. No redirection. No nonsense.

    Share
    Categories
    Computing General

    Is the scroll button the middle button?!

    I recently purchased a really cool Logitech V470 Bluetooth mouse for my new work laptop. It worked well from though I did install the software that came with it just to make sure it did. I have other Logitech mice and they all work the same when you click the scroll dial in the middle of the mouse – it acts as the middle button.

    The middle button usually has the functionality of opening a link you click on in your browser in a new tab. Therefore, it is very useful – you get information without losing the current context of what you are reading. As a result, I expected this behavior to be there by default when I loaded the new mouse software on the machine.

    Surprisingly, Logitech does not regard the scroll wheel/button by default as the middle button. Instead, it assigns it the behavior of ‘Zoom’. Zoom does nothing in Firefox and I do not really need that. Doubt anyone does. So I started looking around to find out where I can change that setting from within the Logitech SetPoint software which you can see below.

    setpoint The middle mouse button functionality was buried deep under the ‘Other’ setting. Once set, your mouse will go back to behaving as it should – or at least as I think it should.

    Share
    Share