IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Servlets/JSP Java Discussion :

utilser un java bean


Sujet :

Servlets/JSP Java

  1. #1
    Membre confirmé
    Inscrit en
    Avril 2007
    Messages
    175
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 175
    Par défaut utilser un java bean
    Bonjour atous ,

    je travaille actuelement sur un projet d'agenda partager , je suis débutant et je rencontre des déficultés pour la réalisation de ce projet .

    j'ai trouvé un bean pour afficher un calendrier , j'ai compiler le bean avec un main sous JAVA et sa marche bien , et maintenant je veux afficher ce calendrier dans une page JSP
    mon code JAVA est le suivant
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
     
    package com.toedter.calendar;
     
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Font;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.Locale;
     
    import javax.swing.BorderFactory;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
     
    /**
     * JCalendar is a bean for entering a date by choosing the year, month and day.
     * 
     * @author Kai Toedter
     * @version $LastChangedRevision: 95 $
     * @version $LastChangedDate: 2006-05-05 18:43:15 +0200 (Fr, 05 Mai 2006) $
     */
    public class JCalendar extends JPanel implements PropertyChangeListener {
    	private static final long serialVersionUID = 8913369762644440133L;
     
    	private Calendar calendar;
     
    	/** the day chooser */
    	protected JDayChooser dayChooser;
    	private boolean initialized = false;
     
    	/** indicates if weeks of year shall be visible */
    	protected boolean weekOfYearVisible = true;
     
    	/** the locale */
    	protected Locale locale;
     
    	/** the month chooser */
    	protected JMonthChooser monthChooser;
     
    	private JPanel monthYearPanel;
     
    	/** the year chhoser */
    	protected JYearChooser yearChooser;
     
    	protected Date minSelectableDate;
     
    	protected Date maxSelectableDate;
     
    	/**
    	 * Default JCalendar constructor.
    	 */
    	public JCalendar() {
    		this(null, null, true, true);
    	}
     
    	/**
    	 * JCalendar constructor which allows the initial date to be set.
    	 * 
    	 * @param date
    	 *            the date
    	 */
    	public JCalendar(Date date) {
    		this(date, null, true, true);
    	}
     
    	/**
    	 * JCalendar constructor which allows the initial calendar to be set.
    	 * 
    	 * @param calendar
    	 *            the calendar
    	 */
    	public JCalendar(Calendar calendar) {
    		this(null, null, true, true);
    		setCalendar(calendar);
    	}
     
    	/**
    	 * JCalendar constructor allowing the initial locale to be set.
    	 * 
    	 * @param locale
    	 *            the new locale
    	 */
    	public JCalendar(Locale locale) {
    		this(null, locale, true, true);
    	}
     
    	/**
    	 * JCalendar constructor specifying both the initial date and locale.
    	 * 
    	 * @param date
    	 *            the date
    	 * @param locale
    	 *            the new locale
    	 */
    	public JCalendar(Date date, Locale locale) {
    		this(date, locale, true, true);
    	}
     
    	/**
    	 * JCalendar constructor specifying both the initial date and the month
    	 * spinner type.
    	 * 
    	 * @param date
    	 *            the date
    	 * @param monthSpinner
    	 *            false, if no month spinner should be used
    	 */
    	public JCalendar(Date date, boolean monthSpinner) {
    		this(date, null, monthSpinner, true);
    	}
     
    	/**
    	 * JCalendar constructor specifying both the locale and the month spinner.
    	 * 
    	 * @param locale
    	 *            the locale
    	 * @param monthSpinner
    	 *            false, if no month spinner should be used
    	 */
    	public JCalendar(Locale locale, boolean monthSpinner) {
    		this(null, locale, monthSpinner, true);
    	}
     
    	/**
    	 * JCalendar constructor specifying the month spinner type.
    	 * 
    	 * @param monthSpinner
    	 *            false, if no month spinner should be used
    	 */
    	public JCalendar(boolean monthSpinner) {
    		this(null, null, monthSpinner, true);
    	}
     
    	/**
    	 * JCalendar constructor with month spinner parameter.
    	 * 
    	 * @param date
    	 *            the date
    	 * @param locale
    	 *            the locale
    	 * @param monthSpinner
    	 *            false, if no month spinner should be used
    	 * @param weekOfYearVisible
    	 *            true, if weeks of year shall be visible
    	 */
    	public JCalendar(Date date, Locale locale, boolean monthSpinner, boolean weekOfYearVisible) {
     
    		setName("JCalendar");
     
    		// needed for setFont() etc.
    		dayChooser = null;
    		monthChooser = null;
    		yearChooser = null;
    		this.weekOfYearVisible = weekOfYearVisible;
     
    		this.locale = locale;
     
    		if (locale == null) {
    			this.locale = Locale.getDefault();
    		}
     
    		calendar = Calendar.getInstance();
     
    		setLayout(new BorderLayout());
     
    		monthYearPanel = new JPanel();
    		monthYearPanel.setLayout(new BorderLayout());
     
    		monthChooser = new JMonthChooser(monthSpinner);
    		yearChooser = new JYearChooser();
    		monthChooser.setYearChooser(yearChooser);
    		monthYearPanel.add(monthChooser, BorderLayout.WEST);
    		monthYearPanel.add(yearChooser, BorderLayout.CENTER);
    		monthYearPanel.setBorder(BorderFactory.createEmptyBorder());
     
    		dayChooser = new JDayChooser(weekOfYearVisible);
    		dayChooser.addPropertyChangeListener(this);
    		monthChooser.setDayChooser(dayChooser);
    		monthChooser.addPropertyChangeListener(this);
    		yearChooser.setDayChooser(dayChooser);
    		yearChooser.addPropertyChangeListener(this);
    		add(monthYearPanel, BorderLayout.NORTH);
    		add(dayChooser, BorderLayout.CENTER);
     
    		// Set the initialized flag before setting the calendar. This will
    		// cause the other components to be updated properly.
    		if (date != null) {
    			calendar.setTime(date);
    		}
     
    		initialized = true;
     
    		setCalendar(calendar);
    	}
     
    	/**
    	 * Creates a JFrame with a JCalendar inside and can be used for testing.
    	 * 
    	 * @param s
    	 *            The command line arguments
    	 */
    	public static void main(String[] s) {
    		JFrame frame = new JFrame("JCalendar");
     
    		JCalendar jcalendar = new JCalendar();
    		frame.getContentPane().add(jcalendar);
    		frame.pack();
    		frame.setVisible(true);
    	}
     
    	/**
    	 * Returns the calendar property.
    	 * 
    	 * @return the value of the calendar property.
    	 */
    	public Calendar getCalendar() {
    		return calendar;
    	}
     
    	/**
    	 * Gets the dayChooser attribute of the JCalendar object
    	 * 
    	 * @return the dayChooser value
    	 */
    	public JDayChooser getDayChooser() {
    		return dayChooser;
    	}
     
    	/**
    	 * Returns the locale.
    	 * 
    	 * @return the value of the locale property.
    	 * 
    	 * @see #setLocale
    	 */
    	public Locale getLocale() {
    		return locale;
    	}
     
    	/**
    	 * Gets the monthChooser attribute of the JCalendar object
    	 * 
    	 * @return the monthChooser value
    	 */
    	public JMonthChooser getMonthChooser() {
    		return monthChooser;
    	}
     
    	/**
    	 * Gets the yearChooser attribute of the JCalendar object
    	 * 
    	 * @return the yearChooser value
    	 */
    	public JYearChooser getYearChooser() {
    		return yearChooser;
    	}
     
    	/**
    	 * Indicates if the weeks of year are visible..
    	 * 
    	 * @return boolean true, if weeks of year are visible
    	 */
    	public boolean isWeekOfYearVisible() {
    		return dayChooser.isWeekOfYearVisible();
    	}
     
    	/**
    	 * JCalendar is a PropertyChangeListener, for its day, month and year
    	 * chooser.
    	 * 
    	 * @param evt
    	 *            the property change event
    	 */
    	public void propertyChange(PropertyChangeEvent evt) {
    		if (calendar != null) {
    			Calendar c = (Calendar) calendar.clone();
     
    			if (evt.getPropertyName().equals("day")) {
    				c.set(Calendar.DAY_OF_MONTH, ((Integer) evt.getNewValue()).intValue());
    				setCalendar(c, false);
    			} else if (evt.getPropertyName().equals("month")) {
    				c.set(Calendar.MONTH, ((Integer) evt.getNewValue()).intValue());
    				setCalendar(c, false);
    			} else if (evt.getPropertyName().equals("year")) {
    				c.set(Calendar.YEAR, ((Integer) evt.getNewValue()).intValue());
    				setCalendar(c, false);
    			} else if (evt.getPropertyName().equals("date")) {
    				c.setTime((Date) evt.getNewValue());
    				setCalendar(c, true);
    			}
    		}
    	}
     
    	/**
    	 * Sets the background color.
    	 * 
    	 * @param bg
    	 *            the new background
    	 */
    	public void setBackground(Color bg) {
    		super.setBackground(bg);
     
    		if (dayChooser != null) {
    			dayChooser.setBackground(bg);
    		}
    	}
     
    	/**
    	 * Sets the calendar property. This is a bound property.
    	 * 
    	 * @param c
    	 *            the new calendar
    	 * @throws NullPointerException -
    	 *             if c is null;
    	 * @see #getCalendar
    	 */
    	public void setCalendar(Calendar c) {
    		setCalendar(c, true);
    	}
     
    	/**
    	 * Sets the calendar attribute of the JCalendar object
    	 * 
    	 * @param c
    	 *            the new calendar value
    	 * @param update
    	 *            the new calendar value
    	 * @throws NullPointerException -
    	 *             if c is null;
    	 */
    	private void setCalendar(Calendar c, boolean update) {
    		if (c == null) {
    			setDate(null);
    		}
    		Calendar oldCalendar = calendar;
    		calendar = c;
     
    		if (update) {
    			// Thanks to Jeff Ulmer for correcting a bug in the sequence :)
    			yearChooser.setYear(c.get(Calendar.YEAR));
    			monthChooser.setMonth(c.get(Calendar.MONTH));
    			dayChooser.setDay(c.get(Calendar.DATE));
    		}
     
    		firePropertyChange("calendar", oldCalendar, calendar);
    	}
     
    	/**
    	 * Enable or disable the JCalendar.
    	 * 
    	 * @param enabled
    	 *            the new enabled value
    	 */
    	public void setEnabled(boolean enabled) {
    		super.setEnabled(enabled);
     
    		if (dayChooser != null) {
    			dayChooser.setEnabled(enabled);
    			monthChooser.setEnabled(enabled);
    			yearChooser.setEnabled(enabled);
    		}
    	}
     
    	/**
    	 * Returns true, if enabled.
    	 * 
    	 * @return true, if enabled.
    	 */
    	public boolean isEnabled() {
    		return super.isEnabled();
    	}
     
    	/**
    	 * Sets the font property.
    	 * 
    	 * @param font
    	 *            the new font
    	 */
    	public void setFont(Font font) {
    		super.setFont(font);
     
    		if (dayChooser != null) {
    			dayChooser.setFont(font);
    			monthChooser.setFont(font);
    			yearChooser.setFont(font);
    		}
    	}
     
    	/**
    	 * Sets the foreground color.
    	 * 
    	 * @param fg
    	 *            the new foreground
    	 */
    	public void setForeground(Color fg) {
    		super.setForeground(fg);
     
    		if (dayChooser != null) {
    			dayChooser.setForeground(fg);
    			monthChooser.setForeground(fg);
    			yearChooser.setForeground(fg);
    		}
    	}
     
    	/**
    	 * Sets the locale property. This is a bound property.
    	 * 
    	 * @param l
    	 *            the new locale value
    	 * 
    	 * @see #getLocale
    	 */
    	public void setLocale(Locale l) {
    		if (!initialized) {
    			super.setLocale(l);
    		} else {
    			Locale oldLocale = locale;
    			locale = l;
    			dayChooser.setLocale(locale);
    			monthChooser.setLocale(locale);
    			firePropertyChange("locale", oldLocale, locale);
    		}
    	}
     
    	/**
    	 * Sets the week of year visible.
    	 * 
    	 * @param weekOfYearVisible
    	 *            true, if weeks of year shall be visible
    	 */
    	public void setWeekOfYearVisible(boolean weekOfYearVisible) {
    		dayChooser.setWeekOfYearVisible(weekOfYearVisible);
    		setLocale(locale); // hack for doing complete new layout :)
    	}
     
    	/**
    	 * Gets the visibility of the decoration background.
    	 * 
    	 * @return true, if the decoration background is visible.
    	 */
    	public boolean isDecorationBackgroundVisible() {
    		return dayChooser.isDecorationBackgroundVisible();
    	}
     
    	/**
    	 * Sets the decoration background visible.
    	 * 
    	 * @param decorationBackgroundVisible
    	 *            true, if the decoration background should be visible.
    	 */
    	public void setDecorationBackgroundVisible(boolean decorationBackgroundVisible) {
    		dayChooser.setDecorationBackgroundVisible(decorationBackgroundVisible);
    		setLocale(locale); // hack for doing complete new layout :)
    	}
     
    	/**
    	 * Gets the visibility of the decoration border.
    	 * 
    	 * @return true, if the decoration border is visible.
    	 */
    	public boolean isDecorationBordersVisible() {
    		return dayChooser.isDecorationBordersVisible();
    	}
     
    	/**
    	 * Sets the decoration borders visible.
    	 * 
    	 * @param decorationBordersVisible
    	 *            true, if the decoration borders should be visible.
    	 */
    	public void setDecorationBordersVisible(boolean decorationBordersVisible) {
    		dayChooser.setDecorationBordersVisible(decorationBordersVisible);
    		setLocale(locale); // hack for doing complete new layout :)
    	}
     
    	/**
    	 * Returns the color of the decoration (day names and weeks).
    	 * 
    	 * @return the color of the decoration (day names and weeks).
    	 */
    	public Color getDecorationBackgroundColor() {
    		return dayChooser.getDecorationBackgroundColor();
    	}
     
    	/**
    	 * Sets the background of days and weeks of year buttons.
    	 * 
    	 * @param decorationBackgroundColor
    	 *            the background color
    	 */
    	public void setDecorationBackgroundColor(Color decorationBackgroundColor) {
    		dayChooser.setDecorationBackgroundColor(decorationBackgroundColor);
    	}
     
    	/**
    	 * Returns the Sunday foreground.
    	 * 
    	 * @return Color the Sunday foreground.
    	 */
    	public Color getSundayForeground() {
    		return dayChooser.getSundayForeground();
    	}
     
    	/**
    	 * Returns the weekday foreground.
    	 * 
    	 * @return Color the weekday foreground.
    	 */
    	public Color getWeekdayForeground() {
    		return dayChooser.getWeekdayForeground();
    	}
     
    	/**
    	 * Sets the Sunday foreground.
    	 * 
    	 * @param sundayForeground
    	 *            the sundayForeground to set
    	 */
    	public void setSundayForeground(Color sundayForeground) {
    		dayChooser.setSundayForeground(sundayForeground);
    	}
     
    	/**
    	 * Sets the weekday foreground.
    	 * 
    	 * @param weekdayForeground
    	 *            the weekdayForeground to set
    	 */
    	public void setWeekdayForeground(Color weekdayForeground) {
    		dayChooser.setWeekdayForeground(weekdayForeground);
    	}
     
    	/**
    	 * Returns a Date object.
    	 * 
    	 * @return a date object constructed from the calendar property.
    	 */
    	public Date getDate() {
    		return new Date(calendar.getTimeInMillis());
    	}
     
    	/**
    	 * Sets the date. Fires the property change "date".
    	 * 
    	 * @param date
    	 *            the new date.
    	 * @throws NullPointerException -
    	 *             if tha date is null
    	 */
    	public void setDate(Date date) {
    		Date oldDate = calendar.getTime();
    		calendar.setTime(date);
    		int year = calendar.get(Calendar.YEAR);
    		int month = calendar.get(Calendar.MONTH);
    		int day = calendar.get(Calendar.DAY_OF_MONTH);
     
    		yearChooser.setYear(year);
    		monthChooser.setMonth(month);
    		dayChooser.setCalendar(calendar);
    		dayChooser.setDay(day);
     
    		firePropertyChange("date", oldDate, date);
    	}
     
    	/**
    	 * Sets a valid date range for selectable dates. If max is before
    	 * min, the default range with no limitation is set.
    	 * 
    	 * @param min
    	 *            the minimum selectable date or null (then the minimum date is
    	 *            set to 01\01\0001)
    	 * @param max
    	 *            the maximum selectable date or null (then the maximum date is
    	 *            set to 01\01\9999)
    	 */
    	public void setSelectableDateRange(Date min, Date max) {
    		dayChooser.setSelectableDateRange(min, max);
    	};
     
    	/**
    	 * Gets the minimum selectable date.
    	 * 
    	 * @return the minimum selectable date
    	 */
    	public Date getMaxSelectableDate() {
    		return dayChooser.getMaxSelectableDate();
    	}
     
    	/**
    	 * Gets the maximum selectable date.
    	 * 
    	 * @return the maximum selectable date
    	 */
    	public Date getMinSelectableDate() {
    		return dayChooser.getMinSelectableDate();
    	}
     
    	/**
    	 * Sets the maximum selectable date.
    	 * 
    	 * @param max maximum selectable date
    	 */
    	public void setMaxSelectableDate(Date max) {
    		dayChooser.setMaxSelectableDate(max);
    	}
     
    	/**
    	 * Sets the minimum selectable date.
    	 * 
    	 * @param min minimum selectable date
    	 */
    	public void setMinSelectableDate(Date min) {
    		dayChooser.setMinSelectableDate(min);
    	}
     
    	/**
    	 * Gets the maximum number of characters of a day name or 0. If 0 is
    	 * returned, dateFormatSymbols.getShortWeekdays() will be used.
    	 * 
    	 * @return the maximum number of characters of a day name or 0.
    	 */
    	public int getMaxDayCharacters() {
    		return dayChooser.getMaxDayCharacters();
    	}
     
    	/**
    	 * Sets the maximum number of characters per day in the day bar. Valid
    	 * values are 0-4. If set to 0, dateFormatSymbols.getShortWeekdays() will be
    	 * used, otherwise theses strings will be reduced to the maximum number of
    	 * characters.
    	 * 
    	 * @param maxDayCharacters
    	 *            the maximum number of characters of a day name.
    	 */
    	public void setMaxDayCharacters(int maxDayCharacters) {
    		dayChooser.setMaxDayCharacters(maxDayCharacters);
    	}
    }
    et j'affiche mon calendrier a l'aid du main suivant :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
    /**
    	 * Creates a JFrame with a JCalendar inside and can be used for testing.
    	 * 
    	 * @param s
    	 *            The command line arguments
    	 */
    	public static void main(String[] s) {
    		JFrame frame = new JFrame("JCalendar");
     
    		JCalendar jcalendar = new JCalendar();
    		frame.getContentPane().add(jcalendar);
    		frame.pack();
    		frame.setVisible(true);
    	}
    comment je peux remplacer ce main dans la page JSP ?

    j'ai crée un page mais sa ne marche pas le serveur ne reconai pas JCalendar , Jframe etc...

  2. #2
    Membre Expert
    Homme Profil pro
    Directeur technique
    Inscrit en
    Janvier 2007
    Messages
    1 348
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Directeur technique

    Informations forums :
    Inscription : Janvier 2007
    Messages : 1 348
    Par défaut
    Une jsp ça s'exécute sur le serveur d'application JAVA ... Or toi tu veux un calendrier côté client ! Je te conseille de (re)lire les tutoriels/cours sur l'architecture 3 tiers ...

  3. #3
    Membre confirmé
    Inscrit en
    Avril 2007
    Messages
    175
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 175
    Par défaut
    Merci pour la réponse chtig ,
    c'est un peut dificile pour moi de comprendre cette architecture des 3 tier mais je veux seulement savoir si je peux utiliser Mon javbean dans ma page JSP ou il faut que je crée un nouveau Code source avec de nouvelles classes, je suis un peut perdu

    Merci d'avance de votre aide

  4. #4
    Modérateur
    Avatar de OButterlin
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    7 313
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 7 313
    Billets dans le blog
    1
    Par défaut
    Non, tu ne peux pas utiliser ton calendrier (ou alors il faudra le convertir en applet)
    Pour faire ce genre d'affichage dans une JSP, il existe (parmis d'autres) la bibliothèque struts-layout et la balise <layout:date ... />
    (Tu n'es pas obligé d'utiliser struts)

    A+
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  5. #5
    Membre confirmé
    Inscrit en
    Avril 2007
    Messages
    175
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 175
    Par défaut
    merci OButterlin, d'après toi quelle est la meilleur soulution pour que je puisse afficher un calendrier qui permet a l'utilisateur de gerer son Agenda, car je travaille sur ce projet qui un peut dificile , et j'avou que j'ai pas choisie le bon sujet , car il faut que je gere les Evenement (Ajout, suppression, modification) avec une base de données
    sinserement tu croit que je peut le faire en une semaine ?


    Merci a tous ceux qui pouvent m'aider même avec une ligne de code ou un conseille

  6. #6
    Modérateur
    Avatar de OButterlin
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    7 313
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 7 313
    Billets dans le blog
    1
    Par défaut
    En 1 semaine, oui, je pense que c'est sans problème pour un débutant.
    Tu es obligé de passer par une page JSP ou tu peux le faire avec une application java ?
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  7. #7
    Membre Expert
    Homme Profil pro
    Directeur technique
    Inscrit en
    Janvier 2007
    Messages
    1 348
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Directeur technique

    Informations forums :
    Inscription : Janvier 2007
    Messages : 1 348
    Par défaut
    En une semaine full time c'est gérable. Mais vraiment la première chose à faire c'est de bien comprendre les notions de base/serveur d'application/client(browser), de servlet/jsp/html sinon tu risques de patauger. (2 jour pour comprendre l'architecture et essayer un framework comme struts)

    Pour la gestion du calendrier elle même, tu as effectivement pas mal d'APIs qui te permettent de les gérer simplement. (je dirais 0,5 j)

    En ce qui concerne le stockage en base, cette partie là est simple, un petit tutoriel jdbc et ça devrait rouler sans problème. (idem 0,5 j max)

    Te restera 2 jours pour le programme en lui même ce qui devrait suffire.

  8. #8
    Membre éclairé
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    331
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 331
    Par défaut
    En 1 semaine, oui, je pense que c'est sans problème pour un débutant.
    pour un membre chevronné ou emerité ...

  9. #9
    Membre confirmé
    Inscrit en
    Avril 2007
    Messages
    175
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 175
    Par défaut
    Vous me rassurer c'est bien vous me redonnez le courage a nouveau

    mon projet et La gestion de l'emploi du temps des emplyés d'une entreprise

    et il faut le faire en JSP c'est une exigence du professeur (chef du projet)

    pour ce qui est serveur d'aplication et browser j'ai des notions de bases je sais déployé une application sur Tomcat et je sais créer une page JSP qui me permet d'ajouter ou supprimer un enregistrement dans une base données.

    mon souci est que je maitrise pas le JAVA et le JSP c'est un mélange de HTML et JAVA , et pour ce la je croi que sa va être difficile pour moi , mais je vais

    Ou je peux trouver les APIS qui me permettent de gerer cet Agenda

    Merci de m'orienter vers des sites qui proposes ces APIs

  10. #10
    Modérateur
    Avatar de OButterlin
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    7 313
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 7 313
    Billets dans le blog
    1
    Par défaut
    Citation Envoyé par decksroy
    pour un membre chevronné ou emerité ...
    Ne t'en fait pas pour ces qualificatifs, c'est juste le nombre de messages qui le détermine (même si ce ne sont que des questions )
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  11. #11
    Membre éclairé
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    331
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 331
    Par défaut
    ce n'etait pas des qualitatifs que je parlais mais de vous

Discussions similaires

  1. Java class + Java Bean d'interface = petit problème
    Par Nyphel dans le forum Eclipse Java
    Réponses: 3
    Dernier message: 30/01/2007, 14h52
  2. JDBC et Java beans
    Par vicros dans le forum JDBC
    Réponses: 3
    Dernier message: 26/12/2006, 22h43
  3. Utilité des java beans dans MVC
    Par Bba_M dans le forum Servlets/JSP
    Réponses: 2
    Dernier message: 16/12/2006, 15h37
  4. Java Beans dans eclipse
    Par subzero82 dans le forum Eclipse Java
    Réponses: 5
    Dernier message: 07/05/2006, 17h46
  5. [Java Beans XMLEncoder] Impossible d'encoder un objet...
    Par petitpepito dans le forum Format d'échange (XML, JSON...)
    Réponses: 1
    Dernier message: 27/02/2006, 16h19

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo