我用容器管理的安全性编写了简单的应用程序.问题是当我登录并打开另一个我注销的页面时,然后我回到第一页,我点击任何链接等或刷新页面我得到这个例外.我想这是正常的(或者可能不是:))因为我退出了会话被破坏了.我该怎么做才能将用户重定向到例如index.xhtml或login.xhtml,并使他免于看到错误页面/消息?
换句话说,如何在我退出后自动将其他页面重定向到索引/登录页面?
这里是:
javax.faces.application.ViewExpiredException: viewId:/index.xhtml - View /index.xhtml could not be restored.
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:212)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at filter.HttpHttpsFilter.doFilter(HttpHttpsFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
Run Code Online (Sandbox Code Playgroud) 我无法在Eclipse上使用自动完成功能.
我正在研究svn上的项目.我通过进入Eclipse在Eclipse中设置项目
文件 - >导入 - >结帐作为项目 - >新建项目向导.
我选择Enterprise Java Application并将其下载.一切似乎工作正常,除了自动完成工作,因为我希望我得到一个显示消息的弹出对话框
此编译单元不在java项目的构建路径上.
我用谷歌搜索了它,但每个人都说该项目必须是Java项目.但是,嘿,它!问题是什么?
svn上的目录结构如下所示:
-Project_name
-application
-META-INF
application.xml
MANIFEST.MF
+build
+db
+deploy
+dist
+lib
+properties
+script
-src
-META-INF
someother.xml (datasource info)
persistence.xml
folder hierarchy with source files (should be package)
-web
some folders
.
.
files
.
.
-WEB-INF
faces-config.xml
jboss-web.xml
web.xml
build_win.xml
Run Code Online (Sandbox Code Playgroud)
如何告诉Eclipse源文件文件夹,application.xml和其他配置xml文件在哪里?
假设我在我的闪存驱动器上安装了Linux.为什么我需要像casper循环文件这样的东西来保存持久性?所以文件正在删除?闪存驱动器与实际硬盘驱动器不一样吗?我是一个Linux菜鸟,所以请耐心等待.
或者是因为闪存驱动器上的Linux实际上就像闪存驱动器上的Live CD一样?可以安装就像安装在硬盘驱动器上一样吗?
假设我想要显示表:
+--------------------------------+
| | | |
----------------------------------
| | |
----------------------------------
| | |
----------------------------------
| | | |
----------------------------------
| | | |
+--------------------------------+
Run Code Online (Sandbox Code Playgroud)
我怎么能这样做h:panelGrid?
Description Resource Path Location Type
WS-I: A problem occured while running the WS-I WSDL conformance check:
org.eclipse.wst.wsi.internal.analyzer.WSIAnalyzerException: null
Nested exception is:
java.lang.NullPointerException
The WSDLAnalyzer was unable to validate the given WSDL File.
ChangedElements.wsdl /wstest/WebContent/wsdl line 1 WSDL Problem
Run Code Online (Sandbox Code Playgroud)
更新:
Netbeans给出了这个错误:
cvc-elt.1: Cannot find the declaration of element 'wsdl:definitions'. [7]
Run Code Online (Sandbox Code Playgroud)
wsdl的一部分:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.example.org/xxx/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="xxx"
targetNamespace="http://www.example.org/xxx/">
Run Code Online (Sandbox Code Playgroud) 假设我有一个包含两列的表。我可以使用以下方法使该表居中:
margin: auto
但假设我希望第二列出现在中间。我怎么做?是否可以?
编辑:
这是我想要实现的目标:
-------------------------------------------------------
| |
| ---------------------------------- |
| |1 column| 2column | |
| |1 column| 2column | |
| |1 column| 2column | |
| |1 column| 2column | |
| |1 column| 2column | |
| ---------------------------------- |
| |
| |
-------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)
第二列位于页面/div 的中心。如果这对表格来说是不可能的,如何用 div 做到这一点?
以下行的结果是什么:
int* ptr;
printf("%x, %x\n", ptr, &ptr);
Run Code Online (Sandbox Code Playgroud)
我知道这ptr是一个记忆中的地址,但是什么&ptr?
问题是,当我在shell中使用时间时,我得到如下输出:
1.350u 0.038s 0:01.45 95.1% 0+0k 0+72io 1pf+0w
Run Code Online (Sandbox Code Playgroud)
当我在脚本中使用它时,我得到:
real 0m1.253s
user 0m1.143s
sys 0m0.047s
Run Code Online (Sandbox Code Playgroud)
我的意思是为什么 在开头的shell脚本中我写道:
#!/bin/bash
Run Code Online (Sandbox Code Playgroud) 我有两个实体User和Group:
@Entity
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private String username;
private String password;
private String email;
@ManyToMany
@JoinTable(name="user_group", joinColumns={@JoinColumn(name="USERNAME")}, inverseJoinColumns={@JoinColumn(name="ID")})
private List<Group> group;
// getters and setters...
}
@Entity
public class Group implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private String id;
// getters and setters...
}
Run Code Online (Sandbox Code Playgroud)
它是ManyToMany的单向.它产生表格user和user_group.现在我有简单的查询:
Query q = em.createQuery("select g from Group g");
List<Group> usersGroup = q.getResultList();
Run Code Online (Sandbox Code Playgroud)
抛出异常:
Exception [EclipseLink-4002] …Run Code Online (Sandbox Code Playgroud) 我想通过execve在C程序中调用一个shell:
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
main()
{
char* path = "/bin/sh";
int err = execve(path, &path, NULL);
printf("%d\n", err);
printf("%s\n", strerror(errno));
printf("%x, %x\n", path, &path);
}
Run Code Online (Sandbox Code Playgroud)
但输出是:
-1
Bad address
80485c0, bf816f4c
Run Code Online (Sandbox Code Playgroud)