从xpages客户端脚本和常规注释表单调用HttpServlet类? [英] Calling HttpServlet class from xpages client side script and regular notes forms?

查看:92
本文介绍了从xpages客户端脚本和常规注释表单调用HttpServlet类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Java的新手(再次有一段时间没有接触过它).

I am new (again, have not touched it in a while) to Java.

我有一个简单的(计划更复杂的)HttpServlet类,我正尝试从网页上从常规Notes形式或xPage上的csjs调用.

I have a simple (much more complex one is planned) HttpServlet class that I am tryng to call from a webpage either from a regular Notes form or csjs on an xPage.

package com.pnc.cld;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HelloWorld extends HttpServlet
{
    private static final long serialVersionUID = -2950148158748149L;

    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    {
        System.out.println("doGet: Hello World!");
    }

    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    {
        System.out.println("doPost: Hello World!"); 
    }
}

我找到了这篇文章该语言原本是中文的,所以很难理解,但从我的掌握中可以发现,您需要添加一个IServletFactory类,该类将Servlet映射到您的url,以便可以在其中调用它.您的浏览器.

Which is orginally in Chinese so it makes it a bit hard to follow but from what I have been able to glean from it, you need a add a IServletFactory class which maps the servlet to your a url so it can be called in your browser.

但是我遇到了错误. 本文修复了其中的一些

But I am getting errors. This article fixed some of them

但是我仍然会遇到很多错误.其中之一:

But I still still get a number of errors. One of them:

类型ServletFactory必须实现继承的抽象方法IServletFactory.getServletMatch(String,String)ServletFactory.java

The type ServletFactory must implement the inherited abstract method IServletFactory.getServletMatch(String, String) ServletFactory.java

此外,本文似乎还说您需要将com.ibm.xsp.adapter.servletFactory添加到services目录,但是我在PC上的任何位置都找不到该文件.

Also the article seems to say that you need to add com.ibm.xsp.adapter.servletFactory to the services directory but I can't find the file anywhere on my PC.

是否有更好的文章或希望的示例可以用来调用httpservlet?

Are there any better articles or hopefully working example for calling an httpservlet out there?

推荐答案

Bruce, 在Domino上,您需要实现servlet OSGi样式.从我的 webDAV for Domino 项目.该servlet肯定可以正常工作!

Bruce, on Domino you need to implement a servlet OSGi style. Go steal the code from my webDAV for Domino project on OpenNTF. The servlet is definitely working!

这篇关于从xpages客户端脚本和常规注释表单调用HttpServlet类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆