 |
Spring MVC, Tiles and Jetty
Posted by johnsmart on July 10, 2007 at 02:53 PM | Comments (5)
This entry is a short note on an issue I found when using Spring MVC, Tiles and Jetty together. I couldn't find any mention of it on Google, so maybe it only happens on my machine (yeah right...). I've been working on a project using Spring MVC and Tiles. I've also been using the (relatively recent) <form> tags, which are cool. And I've been using Jetty to speed up the development cycle. At least, that's the theory...
Anyway, when using Jetty, it seems that the <form> tag renders the "action" attribute as "/WEB-INF/jsp/layout.jsp". This obviously doesn't work. Anyone familiar with Spring MVC will know that the <form> tag should generate an action tag that points back to the current page. Now after digging into the Spring-MVC code, I'm pretty sure it's not Spring's fault. Spring just gets the request URI from the container. And in Tomcat, everything works fine. So if stones are to be thrown, they would probably fall in the jetty.
I wasn't too keen on dropping the nice <form> tags, especially since they worked fine in the target environment (Tomcat). The work-around is actually quite simple, once you know the source of the problem. To get it working in both Tomcat and Jetty, you need to force the action parameter to "?", as shown here:
<form:form commandname="chooseProfile" action="?">
This will force the form to submit to its page of origin, which is exactly what we want.
Jetty is nice as it is fast to start and supports hot-deploy of JSPs, which makes it a good test platform. However, it has a slightly non-standard behaviour in some areas, like this one.
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
Hi John, which version of Jetty are you using? I'm asking because Jetty uses GlassFish JSP implementation, and the problem might also be in GlassFish if you are using Jetty 6.x. Thanks.
Posted by: jfarcand on July 10, 2007 at 03:41 PM
-
I don't know of any non standard behaviour in Jetty. But I do know of several non-compliant "features" in tomcat.... so if stones are to be thrown!
Anyway, I suspect the issue is with glassfish, as it is their JSP that we use for Jetty. If you want the mail me some details to gregw (at) webtide.com, I'll have a look at getting it fixed for the 6.1.5 release.
Posted by: gregwilkins on July 10, 2007 at 04:37 PM
-
I'm using the latest Maven Jetty plugin, which I believe is using Jetty 6.x. Thanks, Greg, I will mail you some details as well.
Posted by: johnsmart on July 10, 2007 at 04:50 PM
-
i'm using Jetty right now for coupla servlets, and loving it cos so easy to embed, like two lines of code it register your servlet innit. I think it is 1Meg or so for the Jetty jars, so that means i can do a WebStart demo of my serlvets with jetty embedded - that's so cool :)
Posted by: evanx on July 11, 2007 at 02:14 PM
-
门诊
癌症
肿瘤
胃癌
肺癌
肝癌
白血病
鼻咽癌
大肠癌
宫颈癌
膀胱肿瘤
食管癌
乳腺癌
抗癌新药
肾癌
胰腺癌
胆囊癌
甲状腺癌
脑瘤
恶性黑色素瘤
恶性淋巴瘤
阴道恶性肿瘤
卵巢恶性肿瘤
绒毛膜癌
子宫内膜癌
阴茎癌
睾丸肿瘤
前列腺癌
癌症
肿瘤
胃癌
肺癌
肝癌
白血病
鼻咽癌
大肠癌
宫颈癌
膀胱癌
食管癌
食道癌
乳腺癌
抗癌新药
肾癌
胰腺癌
胆囊癌
直肠癌
甲状腺癌
脑膜瘤
恶性黑色素瘤
恶性淋巴瘤
阴道恶性肿瘤
卵巢癌
绒毛膜癌
子宫内膜癌
阴茎癌
睾丸肿瘤
前列腺癌
肝病
肝病治疗
乙肝
乙型肝炎
丙肝
脂肪肝
肝纤维化
肝硬化
肝性脑病
紫杉醇注射液
开普拓
美罗华
赫赛汀
天地欣
香菇多糖
艾普升
宁得朗
康士得
诺雷得
瑞宁得
芙瑞
瑞婷
法乐通
易瑞沙
多吉美
特罗凯
泰勒宁
路盖克
皮肤病
银屑病|牛皮癣
白癜风
尖锐湿疣
脱发
痤疮|青春痘
皮炎
灰指甲
疤痕|瘢痕
疱疹
系统性红斑狼疮
色斑
艾滋病
丽科杰
里亚美
明欣利迪
疣迪
明竹欣
无为白癜风胶囊
维阿露
白癜净
达霏欣
狼疮丸
适今可
克银丸
云香十五味丸
化瘀祛斑胶囊
疤痕敌
每宜
新药网
肺癌
鼻咽癌
食道癌
胃癌
肝癌
大肠癌
乳腺癌
卵巢癌
膀胱癌
白血病
胰腺癌
宫颈癌
神经内科
癫痫
帕金森病
老年性痴呆
脑血管病
多发性硬化症
偏头痛
小儿脑瘫
心血管
高血压
高血脂症
心血管疾病
精神心理
精神分裂症
抑郁症|焦虑症|躁抑症
强迫症
睡眠障碍
多动症
神经衰弱
糖尿病
类风湿
瑞美隆
肉蔻五味丸
喜普妙
怡诺思
优克
恩经复
申捷
重塑杰
施捷因
神经妥乐平
七十味珍珠丸
珊瑚七十味丸
郝智片
参蛇偏瘫胶囊
扎冲十三味丸
洛斯宝
安理申
金思平
泰舒达
珂丹
利鲁唑
力如太
静灵口服液
地牡宁神口服液
健儿贴
哈伯因
肺癌
小细胞肺癌
非小细胞肺癌
肺膦癌
肺腺癌
香菇多糖
瑞宁得
复方斑蝥胶囊
金复康口服液
癌症博客
癌症博客
癌症博客
癌症博客
癌症博客
癌症博客
中国癌症之家
癌症博客
癌症博客
癌症博客
癌症博客
癌症博客
癌症博客之家
癌症博客
癌症博客
癌症博客
癌症博客
中国癌症博客
癌症博客
癌症博客
癌症博客
癌症博客
癌症博客
癌症博客
癌症信息博客
癌症博客
癌症博客
癌症博客
癌症博客
癌症博客
癌症博客
癌症博客
癌症博客
癌症博客
癌症博客
癌症博客网
癌症博客
癌症博客中国人
癌症博客
癌症博客
癌症博客
癌症博客
中国癌症博客
癌症博客
癌症博客
癌症博客
癌症博客
特罗凯博客
特罗凯博客
特罗凯博客
特罗凯博客
特罗凯博客
特罗凯博客
特罗凯博客
特罗凯博客
特罗凯博客
抗癌博客
抗癌博客
抗癌博客
抗癌博客
抗癌博客
抗癌博客
抗癌博客
抗癌博客
抗癌博客
抗癌博客
抗癌博客
特罗凯博客
特罗凯博客
特罗凯博客
特罗凯博客
特罗凯博客
特罗凯博客
特罗凯博客
特罗凯博客
特罗凯博客
易瑞沙博客
易瑞沙博客
易瑞沙博客
易瑞沙博客
易瑞沙博客
易瑞沙博客
易瑞沙博客
易瑞沙博客
易瑞沙博客
易瑞沙博客
易瑞沙博客
易瑞沙博客
易瑞沙博客
Posted by: bxz on August 17, 2007 at 01:00 AM
|