小编Kap*_*pil的帖子

如何在java中设置八进制的值?

我正在尝试编写以下代码.但它给了我错误,请帮助我.

    int six=06;
    int seven=07;
    int abc=018;
    int nine=011;
    System.out.println("Octal 011 ="+nine);
    System.out.println("octal O18 =" + abc);
Run Code Online (Sandbox Code Playgroud)

为什么我不能给018和019变量.我可以给变量赋值020和021.为什么会这样?这背后的原因是什么,请告诉我.
我得到了以下错误

            integer number too large: 018
            int eight=018;
Run Code Online (Sandbox Code Playgroud)

java octal

9
推荐指数
7
解决办法
4万
查看次数

如何解决jsp页面的错误?

我在java文件中有字符串类型方法,它包含字符串数组,当我尝试在jsp中调用时,它给了我一个错误.

public String[] ordering(ActionRequest actionRequest,ActionResponse actionResponse)  
    throws IOException,PortletException
Run Code Online (Sandbox Code Playgroud)

JSP:

<% 
  TestiPortlet obj=new TestiPortlet();
  String str[]=obj.ordering(actionRequest,actionResponse);
  out.println(str[0]);
%>
Run Code Online (Sandbox Code Playgroud)

错误:

Multiple annotations found at this line:- actionResponse cannot be resolved to a     variabl-actionRequest cannot be resolved to a variable

    Stacktrace:
    javax.portlet.PortletException: org.apache.jasper.JasperException: An exception occurred processing JSP page /html/testi/list.jsp at line 8

    5: 
    6: <% 
    7:   TestiPortlet obj=new TestiPortlet();
    8:   String str[]=obj.ordering(actionRequest,actionResponse);
    9:   out.println(str[0]);
    10: %>
    11: 
Run Code Online (Sandbox Code Playgroud)

java eclipse jsp liferay

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

如何用JSP变量检查条件?

你好我是新的jsp我想检查jsp中的条件.值是否为空.?我在jsp页面中编写了以下代码

   <% String s = request.getParameter("search"); %>
    <%=s %>
    <% if (<%=s ==null) { %> 
     <div>textbox is empty</div>

   <% } else { %>
   <div>textbox value..
    <% } %>
Run Code Online (Sandbox Code Playgroud)

如果textbox值为null,我在变量中获取文本框值,然后它应显示第一个消息othervise second.告诉我该怎么办?

java jsp

0
推荐指数
2
解决办法
4万
查看次数

标签 统计

java ×3

jsp ×2

eclipse ×1

liferay ×1

octal ×1