在java中提供会话超时时会发生什么?

时间:2017-01-12 13:00:11

标签: java session

 <webapp> ...   
     <session-config>
         <session-timeout>-1</session-timeout>    
     </session-config> 
 </webapp>

当你给出会话超时时会发生什么是-1。

1 个答案:

答案 0 :(得分:2)

对于数值,负值(尽管最常见的只是public class MyCursorAdapter extends CursorAdapter { public MyCursorAdapter (Context context, Cursor cursor) { super(context, cursor, 0); } @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { return LayoutInflater.from(context).inflate(R.layout.list_cursor, parent, false); } @Override public void bindView(View view, Context context, Cursor cursor) { TextView txtLastName= (TextView) view.findViewById(R.id.txtLastName); TextView txtFirstName= (TextView) view.findViewById(R.id.txtFirstName); String lastName = cursor.getString(cursor.getColumnIndexOrThrow("last_name")); String firstName = cursor.getString(cursor.getColumnIndexOrThrow("first_name")); txtLastName.setText(body); txtFirstName.setText(String.valueOf(priority)); } } )通常意味着-1,如果负值在逻辑上没有任何意义,例如超时或大小等。