首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Glassfish Realm Netbeans 8.0.2 Glassfish 4.1

Glassfish Realm Netbeans 8.0.2 Glassfish 4.1
EN

Stack Overflow用户
提问于 2015-01-23 00:10:16
回答 2查看 356关注 0票数 0

我正在开发一个web应用程序,试图保护登录用户对JSP的访问,我决定使用glassfish领域,我从互联网上做了很多教程,但问题总是一样的。

我无法登录,是不是因为大多数教程都在使用glassfish 3.x?

我在这里看到过类似的帖子,但没有人给出答案

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <security-constraint>
        <display-name>admin</display-name>
        <web-resource-collection>
            <web-resource-name>prywatne</web-resource-name>
            <description/>
            <url-pattern>/prywatne/*</url-pattern>
            <http-method>GET</http-method>
            <http-method>PUT</http-method>
            <http-method>HEAD</http-method>
            <http-method>POST</http-method>
            <http-method>OPTIONS</http-method>
            <http-method>TRACE</http-method>
            <http-method>DELETE</http-method>
        </web-resource-collection>
        <auth-constraint>
            <description/>
            <role-name>admin</role-name>
        </auth-constraint>
    </security-constraint>
    <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>annRealm</realm-name>
    </login-config>
    <security-role>
        <description/>
        <role-name>admin</role-name>
    </security-role>
    <security-role>
        <description/>
        <role-name>user</role-name>
    </security-role>
</web-app>
EN

回答 2

Stack Overflow用户

发布于 2015-01-23 03:24:54

看起来问题是你没有在你的web.xml中设置FacesServlet

在您的web.xml中添加以下内容

代码语言:javascript
复制
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
    <welcome-file>loginForm.xhtml</welcome-file>
</welcome-file-list>

如果需要,您还可以更改欢迎文件的

另请参阅:

  • The Java EE 6 Tutorial - Basic Requirements of a JavaServer Faces Application
票数 0
EN

Stack Overflow用户

发布于 2015-01-23 19:35:24

多亏了这段视频https://www.youtube.com/watch?v=1xsU6juUZd0,问题解决了

我没有使用加密,所以我没有设置。无论如何,问题是在用户表和组表的域中,仅有表名是不够的,但模式databasename.tablename可以提供帮助

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28093454

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档