我可以在Struts中使用SEO友好的URL吗? [英] Can I have SEO friendly urls in Struts?

查看:153
本文介绍了我可以在Struts中使用SEO友好的URL吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用程序中使用SEO友好的URL,它将使用Struts(1/2)在java / j2ee中构建。

I want to have SEO friendly urls in my application, which will be built in java/j2ee using Struts (1/2).

我有以下分类

county/countryname
county/state/statename
county/state/locality/localitname

我猜以上网址是seo友好的吗?

I guess above URLs will be seo friendly?

我如何使用Struts而不是像 / county ='xyz'

How can I have such URLs with Struts instead of something like /county='xyz' ?

推荐答案

使用 urlrewrite 库,它将与大多数java web框架很好地集成。

use urlrewrite library, it will integrate nicely with most of the java web frameworks.

示例来自这里


在以下示例请求中
/ world / usa / nyc 将透明
转发给
/world.jsp?country= usa& city = nyc

<rule enabled="true">
   <from>^/world/([a-z]+)/([a-z]+)$</from>
   <to>/world.jsp?country=$1&amp;city=$2</to>
</rule>


这篇关于我可以在Struts中使用SEO友好的URL吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆