我刚刚在Ubuntu 12.04中设置了apache/php/mysql,我为我的虚拟目录创建了一个Alias,这是我的/ etc/apache2/sites-enabled/000-default文件:
Alias /demo/ "/home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio"
<Directory "/home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio">
DirectoryIndex index.php
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)
请注意,我已经将chown和chmod应用于:/ home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio
chown www-data:www-data /home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio -R
chmow 777 /home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio -R
Run Code Online (Sandbox Code Playgroud)
但是当我访问:_http:// localhost/demo时,我收到了404 Not found错误.看看/var/log/apache2/error.log我发现它仍然指向/ var/www/demo:
File does not exist: /var/www/demo
Run Code Online (Sandbox Code Playgroud)
知道为什么Alias被忽略了吗?
请注意,我已经重新启动并重新加载apache2.并且还启用了重写.
谢谢,
czetsuya
我知道这个问题已被问过几次,但我似乎无法找到我的代码有什么问题,所以我再次要求它 - 抱歉:-).
我目前正在使用部署在Glassfish上的JavaEE6框架上的JSF2.1.对于抛出此错误的页面,我有一个baseTemplate,其中包含页眉和页脚.然后我有一个继承baseTemplate的页面,基本上它们是:BaseTemplate:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<f:view>
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<link rel="shortcut icon" href="" />
<h:outputStylesheet library="css" name="site.css" target="head"></h:outputStylesheet>
<ui:insert name="head" />
</h:head>
<h:body>
<div id="wrapper" class="rounded-box">content...
Run Code Online (Sandbox Code Playgroud)
头
<?xml version='1.0' encoding='UTF-8' ?>
<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<div class="header">
Run Code Online (Sandbox Code Playgroud)
页脚只包含普通的html标签.
和实际的页面,这是一个登录.
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
template="/shared/page/_twoColumn.xhtml"> …Run Code Online (Sandbox Code Playgroud) 我有一个无状态会话bean的ejb.我有从每个bean访问的接口或从另一台机器的另一个ejb远程调用.在invy中,我记得我们正在使用类似:publish-remote,publish-api.可以用maven完成同样的事情吗?
在单独的jar中发布接口,以包含在另一个项目中.
谢谢,
czetsuya
我有另一个案例就是这个问题,我有一个模型,它扩展了一个基本实体,并且该基本实体具有属性id.我使用该id作为rowKey,它会抛出此错误.当我将rowKey的值设置为模型(而不是抽象基础)中的任何属性时,数据表工作.
请注意,我正在使用JavaEE6.
型号:
@Entity
@SequenceGenerator(name = "ID_GENERATOR", sequenceName = "USER_ADDRESS_SEQ")
public class UserAddress extends BaseEntity { //.. }
@MappedSuperclass
public abstract class BaseEntity implements Serializable, IEntity {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(generator = "ID_GENERATOR")
@Column(name = "ID")
private Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
} ..
Run Code Online (Sandbox Code Playgroud)
JavaEE6 bean:
@Stateless
@Named
public class UserAddressBean implements Serializable {
private static final long serialVersionUID = -6104153017102665096L;
private List<UserAddress> …Run Code Online (Sandbox Code Playgroud) 这可能吗?
class A<T extends Service<E extends Entity>>
Run Code Online (Sandbox Code Playgroud)
这是因为我想获得服务和实体的类型.或者其他任何方式来做它?
目前我有一个设置服务的抽象方法,但如果我可以在参数中做得更好.
I'm also wondering how can I pass the parameters in a base class:
I have ClassA that extends SubBaseClass1 that extends BaseClass1.
So:
class SubBaseClass1<E extends Entity, P extends Service<E>> { }
Run Code Online (Sandbox Code Playgroud)
In BaseClass, I want to know the type of P and E.
Another question, if I have a method getBaseClass from another class, how will I specify the return type?:
public BaseClass<E extends Entity, T extends Service<E>> getBaseClass() { …Run Code Online (Sandbox Code Playgroud) 使用EntityFramework codefirst的最新版本(4.3),我创建了一个包含Enabled(bit)列的表.然后我发现它的默认值为false,我可以将默认值设置为true吗?
当我将列重命名为Disabled时,我发现了一些奇怪的东西,默认值变为null.