可以的啊。。
servele 
action都有这种传法啊。

解决方案 »

  1.   


    parseInt
    public static int parseInt(String s)
                        throws NumberFormatException
    Parses the string argument as a signed decimal integer. The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' ('\u002D') to indicate a negative value. The resulting integer value is returned, exactly as if the argument and the radix 10 were given as arguments to the parseInt(java.lang.String, int) method. Parameters:
    s - a String containing the int representation to be parsed 
    Returns:
    the integer value represented by the argument in decimal. 
    Throws: 
    NumberFormatException - if the string does not contain a parsable integer.parseFloat
    public static float parseFloat(String s)
                            throws NumberFormatException
    Returns a new float initialized to the value represented by the specified String, as performed by the valueOf method of class Float. Parameters:
    s - the string to be parsed. 
    Returns:
    the float value represented by the string argument. 
    Throws: 
    NumberFormatException - if the string does not contain a parsable float.
    Since: 
    1.2 
    See Also:
    valueOf(String)parseDouble
    public static double parseDouble(String s)
                              throws NumberFormatException
    Returns a new double initialized to the value represented by the specified String, as performed by the valueOf method of class Double. Parameters:
    s - the string to be parsed. 
    Returns:
    the double value represented by the string argument. 
    Throws: 
    NumberFormatException - if the string does not contain a parsable double.
    Since: 
    1.2 
    See Also:
    valueOf(String)parseLong
    public static long parseLong(String s)
                          throws NumberFormatException
    Parses the string argument as a signed decimal long. The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' (\u002D') to indicate a negative value. The resulting long value is returned, exactly as if the argument and the radix 10 were given as arguments to the parseLong(java.lang.String, int) method. 
    Note that neither the character L ('\u004C') nor l ('\u006C') is permitted to appear at the end of the string as a type indicator, as would be permitted in Java programming language source code. 
    Parameters:
    s - a String containing the long representation to be parsed 
    Returns:
    the long represented by the argument in decimal. 
    Throws: 
    NumberFormatException - if the string does not contain a parsable long.
      

  2.   

    <%@ page  import="java.io.*,java.util.Date"%>
    <%
    String date_end="2003-01-02";
    java.sql.Date myDateEnd=java.sql.Date.valueOf(date_end);
    Date now=new Date();out.println("时间:"+now.getYear()+"-"+now.getMonth()+"-"+now.getDate()+" "+now.getDay()+" "+now.getHours()+":"+now.getMinutes()+":"+now.getSeconds());        var time_now=new Date();
            var hours_now=time_now.getHours();
            var minutes_now=time_now.getMinutes();
            var seconds_now=time_now.getSeconds();
            var year_now=time_now.getYear();
            var month_now=time_now.getMonth();
            var date_now=time_now.getDate();
            var day_now=time_now.getDay();DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
    Date date = (Date)formatter.parse("2000-11-23");
      

  3.   

    String strOut = "";java.text.SimpleDateFormat dft = 
        new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    strOut = dft.format(date);Date now=new Date();
    int year=now.getYear()+1900;
    out.println("时间:"+year+"-"+now.getMonth()+"-"+now.getDate()+" "+now.getDay()+" "+now.getHours()+":"+now.getMinutes()+":"+now.getSeconds());