小编sca*_*anE的帖子

postgis st_distance返回不正确的结果

我使用postgis来计算2个地理坐标之间的距离.

select st_distance(
  'POINT(15.651955 73.712769)'::geography, 
  'POINT(14.806993 74.131451)'::geography) AS d;
Run Code Online (Sandbox Code Playgroud)

它返回我53536.743496517米,大约等于54km,但实际距离是103km,我通过http://boulter.com/gps/distance/计算

我在查询中做错了吗?

postgresql postgis postgresql-9.1

4
推荐指数
1
解决办法
1061
查看次数

使用struts2动态地将id分配给tr标签

我有一个ArrayListfirmId, firmName,address,phoneNumber,status 领域的公司.我想动态分配firmId给每一行.

<s:iterator value="firms">
<tr>

    <td align="left" class="Edit">
        <img src="../images/btn-edit.png" title="Edit" width="27" height="25" alt='Edit' />
    </td>
    <td align="left"><s:property value="firmName" /></td>
    <td align="left"><s:property value="address" /></td>
    <td align="left"><s:property value="phoneNumber" /></td>
    <td align="left"><s:property value="status" /></td>

</tr>

</s:iterator>
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?

jsp struts2

2
推荐指数
1
解决办法
1912
查看次数

Hibernate映射异常

我有2个Entity类ParameterGroupBean和GroupLevelBean

import javax.persistence.*;
import java.util.ArrayList;
import java.util.Collection;


@Entity
@Table(name="tbl_ParameterGroups")
public class ParameterGroupBean {


@Id
@GeneratedValue
private int ParameterGroupId;
private String ParameterGroupName;  
private Boolean Status;

@ManyToOne
@JoinColumn(name="LevelId")
private GroupLevelBean level = new GroupLevelBean();

public GroupLevelBean getLevel() {
    return level;
}

public void setLevel(GroupLevelBean level) {
    this.level = level;
}

@Id
@GeneratedValue
public int getParameterGroupId() {
    return ParameterGroupId;
}

public void setParameterGroupId(int parameterGroupId) {
    ParameterGroupId = parameterGroupId;
}

@Column(length=120) 
public String getParameterGroupName() {
    return ParameterGroupName;
}

public void setParameterGroupName(String parameterGroupName) {
    ParameterGroupName …
Run Code Online (Sandbox Code Playgroud)

java struts hibernate struts2

2
推荐指数
1
解决办法
102
查看次数

Spring安全核心插件:用户的不同主页,具体取决于其角色

我在Grails应用程序中集成了Spring安全核心插件.

grails.plugins.springsecurity.successHandler.defaultTargetUrl = "/user/home"
Run Code Online (Sandbox Code Playgroud)

这是我在成功登录后设置默认主页所做的工作.但我希望根据用户角色拥有不同的主页

目前我有2个用户角色1)"ROLE_ADMIN"2)"ROLE_USER"

我该如何实现?

grails spring-security

0
推荐指数
1
解决办法
2143
查看次数