javaseostruts-1friendly-url

How Can I rewrite SEO friendly URL on STRUTS?


We have a website which is coded Java with Struts Framework. The WebSite's Urls are not seo friendly. All of them are like below

../buyerApplication.do&companyId=2323

Now We want to make these URLs SEO friendly and I searched and found these solutions:

I am waiting your sugestions to solve this problem best.


Solution

  • To the point, you need a Filter for this.

    If you want to keep your existing application's architecture, you'll need to define and create a set of rules to convert unfriendly urls to friendly urls and let the filter convert it and forward the request to the unfriendly url.

    If there is no means of modifying an existing application but you want to create a new application based on this idea, you could consider to having a single page controller which translates the HttpServletRequest#getPathInfo()/getRequestURI() to execute the appropriate action class (command pattern) and finally forward the request to the appropriate JSP page. Not sure how that would fit into Struts as I haven't worked with Struts previously.