¿Qué significan los dos puntos en la URL?
Ejemplo
/viewthread.jsp?id=1234
/viewthread.jsp?id=1235
/viewthread.jsp? id=1236
Después de reescribir, puede usar
/viewthread/1234.htm.viewthread/1234.htm
/viewthread/1235.htm
p>/viewthread/1236.htm
Actualmente estoy usando Tomcat+Apache y he probado tres métodos de reescritura
Filtros I.Tomcat
El más típico es utilizar la biblioteca de clases urlReweite. Si tiene experiencia, no le resultará demasiado complicado escribirla usted mismo. También puede utilizar el filtro de reescritura de URL gratuito y de código abierto ya preparado.
<%
response.setStatus(HttpServletResponse.SC_OK);
Clave de cadena = (Cadena) request.getAttribute("javax.servlet. forward.servlet_path ");
if (key ! = null) {
int index = key.lastIndexOf("/");
if (index ! = - 1) {
clave = key.subring(index + 1);
if (key.startsWith("f") || key.startsWith("p")) {
intentar {
long id = Long.parseLong (key.substring(1));
String url = key.startsWith("f") ? "forumdisplay.jsp?fid=" : "viewthread.jsp?tid="
%>
<%
return;
} catch (Excepción ex) {}
} p>