小编Gio*_*ani的帖子

如何在JSP中包含HTML?

我搜索过这个问题,有一些答案,但不完全是我的问题.所以这是我的jsp代码:

<body>
    <%
        if (manager.isValid(request.getParameter("username"),request.getParameter("password"))){
            out.print("<h1> Welcome ");
            out.print(request.getParameter("username") + "</h1>");
        } else {
            out.print("<h1> Please Try Again </h1> <br />");
            out.print("Either your username or password is incorrect. Please Try again <br /> <br />");
                        }
    %>
    <%@ include file="LoginForm.html" %>
Run Code Online (Sandbox Code Playgroud)

但不是这个,我想只在"else"块中包含"loginForm.html".我该怎么做?当然这不起作用,但你会猜到我想要的:

<%
        if (manager.isValid(request.getParameter("username"),request.getParameter("password"))){
            out.print("<h1> Welcome ");
            out.print(request.getParameter("username") + "</h1>");
        } else {
            out.print("<h1> Please Try Again </h1> <br />");
            out.print("Either your username or password is incorrect. Please Try again <br /> <br />");
            include file="LoginForm.html" ;
        }
    %>
Run Code Online (Sandbox Code Playgroud)

html java jsp

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

Android ListView在滚动时重复项目

我正在研究Android项目.我的一个活动有内部类ChatHistoryAdapter.当活动开始时,列表会正确显示,但滚动后,某些项目会重复.我搜索过解决方案,但几乎每个解决方案都是setTag()或Inflater.我觉得我的代码对他们来说还行.所以我真的不明白这里的问题是什么......

private class ChatHistoryAdapter extends BaseAdapter {
    private LayoutInflater inflater;

    public ChatHistoryAdapter( LayoutInflater inflater) {
        this.inflater = inflater;
    }

    public void newOne() {
        notifyDataSetChanged();

    }

    @Override
    public int getCount() {
        return messages.size();
    }

    @Override
    public Object getItem(int i) {
        return messages.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int position, View myView, ViewGroup vg) {
        MessageHolder messageHolder;

        if (myView == null){
            myView = this.inflater.inflate(R.layout.chat_list_item, null, false);
            messageHolder = new MessageHolder();
            messageHolder.hisTxt = (TextView)myView.findViewById(R.id.hisText);
            messageHolder.myTxt …
Run Code Online (Sandbox Code Playgroud)

java android listview baseadapter

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

ORA-12728: 正则表达式中的范围无效

我想检查表中是否插入了有效的电话号码,所以我的触发代码在这里:

 select start_index
              into mob_index
              from gmarg_mobile_operators
              where START_INDEX = substr(:new.contact_info,0,3);

              if (REGEXP_LIKE (:NEW.CONTACT_INFO,'^(?:'|| mob_index ||')[\-,\:]{0,1}[0-9][0-9][\-,\:]{0,1}[0-9][0-9][\-,\:]{0,1}[0-9][0-9]')) then
                found := 1;
              end if;
Run Code Online (Sandbox Code Playgroud)

我检查了我的正则表达式:“^(?:555)[-,:]{0,1}[0-9][0-9][-,:]{0,1}[0-9][ 0-9][-,:]{0,1}[0-9][0-9]"在几个在线工具上都是正确的。

当我运行触发器时,它编译成功,但在插入行期间显示以下错误:

 insert into GMARG_CONTACTS
(CLINET_ID,CONTACT_INFO,contact_type_id)
values
(0,'555194117','Mobile')
Error report -
SQL Error: ORA-12728: invalid range in regular expression
ORA-06512: at "HR.GMARG_TRIGGER_CONTACT", line 12
ORA-04088: error during execution of trigger 'HR.GMARG_TRIGGER_CONTACT'
12728. 00000 -  "invalid range in regular expression"
*Cause:    An invalid range was found in the regular expression.
*Action:   Ensure a valid range is being used. …
Run Code Online (Sandbox Code Playgroud)

regex sql oracle

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

标签 统计

java ×2

android ×1

baseadapter ×1

html ×1

jsp ×1

listview ×1

oracle ×1

regex ×1

sql ×1