如何配置jbuilder?

04-02-04 abcdefg

我用jbuilder新建了一个非常简单的webapp程序,这个程序只有一个index.jsp文件,在web.xml文件中设置表单验证或者是basic验证,

如下:

<security-constraint>

<display-name>test</display-name>

<web-resource-collection>

<web-resource-name>test resource</web-resource-name>

<url-pattern>/*</url-pattern>

<http-method>GET</http-method>

<http-method>POST</http-method>

</web-resource-collection>

<auth-constraint>

<role-name>admin</role-name>

</auth-constraint>

<user-data-constraint>

<transport-guarantee>NONE</transport-guarantee>

</user-data-constraint>

</security-constraint>

<login-config>

<auth-method>BASIC</auth-method>

<realm-name>test</realm-name>

</login-config>

在运行该程序时,jbuilder总是报错:

ContextConfig[]: No Realm has been configured to authenticate against

ContextConfig[]: Marking this application unavailable due to previous error(s)

程序也运行不起来,我尝试修改了jbuilder自带的tomcat的server.xml文件的realm和jbuilder生成的server8080.xml文件,可是一点用也没有。但是如果我将这个程序打包放在tomcat中,启动tomcat却能看见效果。

这是为什么?我应该怎么做才能使程序能在jbuilder中直接运行起来呢?谢谢指教!

abcdefg
2004-02-04 17:43

以上看不见的配置是这样的:

<security-constraint>
    <display-name>test</display-name>
    <web-resource-collection>
      <web-resource-name>test resource</web-resource-name>
      <url-pattern>/*</url-pattern>
      <http-method>GET</http-method>
      <http-method>POST</http-method>
    </web-resource-collection>
    <auth-constraint>
      <role-name>role1</role-name>
    </auth-constraint>
    <user-data-constraint>
      <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
  </security-constraint>
  <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>test</realm-name>
  </login-config>
<p>