小编Sun*_*van的帖子

SQL在单个命令中在表中添加列和注释

我正在使用Oracle 11g作为我的Web应用程序.我想在现有表中添加列和注释.我可以使用以下命令轻松完成

ALTER TABLE product ADD product_description VARCHAR2(20)
Run Code Online (Sandbox Code Playgroud)

COMMENT ON COLUMN product.product_description 
     IS 'This is comment for the column';
Run Code Online (Sandbox Code Playgroud)

但我想在单一命令中执行上述任务.我在互联网上搜索了一个命令,在一个命令中添加一个列和注释,但我找不到.我想知道这是否可行.任何建议都将受到高度赞赏.

sql oracle oracle11g

42
推荐指数
3
解决办法
13万
查看次数

JavaFX 2.2在javascript和webview中进行双向通信

我正在使用JavaFX 2.2,我正在使用webview将html代码集成到JavaFX场景中,并且能够正确加载html.我正在关注链接并尝试将一些对象从javascript传递到webview/controller但我在java端获取空值.

我在JSObject中保存了一个接口对象,如下所示

webEngine.getLoadWorker().stateProperty().addListener(
        new ChangeListener<State>() {
            @Override
            public void changed(ObservableValue<? extends State> ov,
                State oldState, State newState) {
                if (newState == State.SUCCEEDED) {
                        JSObject win = (JSObject) webEngine.executeScript("window");
                        win.setMember("app", new JavaApp());
                    }
                }
            }
    );
Run Code Online (Sandbox Code Playgroud)

我创建了一个类

public class JavaApp {

        public void exit() {
           Platform.exit();
        }
        public void print(Date date) {
            System.out.println("Parm:"+date);
         }
        public Date getValue() {
            return new Date();
         }
    }
Run Code Online (Sandbox Code Playgroud)

我的HTML是

<html lang="en">
<head>
    <script type="text/javascript">
        function callJava(){
            app.print(new Date());
            var val = app.getValue();
            app.print(val); …
Run Code Online (Sandbox Code Playgroud)

html javascript webview javafx-2

5
推荐指数
1
解决办法
5044
查看次数

无法访问包含的JSP内的变量

我在我的应用程序中使用Spring 2.5.在视图中我有主jsp,其中我包含了另一个jsp.我在主jsp中使用c:set标签声明了一个变量,我无法在jsp中访问它.下面是代码main.jsp

<c:set var="hPediquestStudy"><spring:message code="study.hpediquest.mapping" /></c:set>
<c:set var="currentStudy" value='<%=(String)session.getAttribute("currentStudy")%>'/>
<html>
<head>
</head>
<body>
<c:if test="${currentStudy eq hPediquestStudy}">
  Variables are equal
</c:if>
<c:if test="${currentStudy ne hPediquestStudy}">
  Variables are not equal
</c:if>
<jsp:include page="/WEB-INF/jsp/included.jsp"></jsp:include>
</body
</html>
Run Code Online (Sandbox Code Playgroud)

included.jsp

<c:if test="${currentStudy eq hPediquestStudy}">
   hPediquestStudy Variable is accessible
</c:if>
 <br/>currentStudy : ${currentStudy}
 <br/>hPediquestStudy : ${hPediquestStudy}
Run Code Online (Sandbox Code Playgroud)

我正在输出

变量是平等的

currentStudy:hPediquest

hPediquestStudy:

  1. 为什么在主jsp上两个值都相等而在包含jsp中我看不到它的值?
  2. 为什么currentStudy在包含的jsp中显示其值?
  3. 是否有任何解决方案可以帮助我访问父jsp中的变量集ans可以在包含的jsps中访问?

如果我在主jsp中包含jsp中设置该变量,我可以看到hPediquestStudy值的值.但是每次我加入jsp时我都不想设置它.请帮忙

spring jsp jstl el

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

标签 统计

el ×1

html ×1

javafx-2 ×1

javascript ×1

jsp ×1

jstl ×1

oracle ×1

oracle11g ×1

spring ×1

sql ×1

webview ×1