Re: reset() on ActionForm ???

2002-03-17 Thread @Basebeans.com

Subject: Re: reset() on ActionForm 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 33!
8 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 641 642 643 644 645 646 647 648 
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 
691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 
712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 
733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 
754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 
775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 
796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 
817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 !
833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 
854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 
875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 
896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 
917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 
938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 
959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 
980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999
From: "blinky" <[EMAIL PROTECTED]>
 ===
Michael,

Not sure how the numbers got generated (not my intention to send them) but
somewhere it looks like my three question marks in subject got enumerated as
if a numeric wildcard!!!

ie. my Subject started out from here (when typed anyway) as : reset() on
ActionForm ???

Re the actual reset issue I was writing about, I've got no problem having
the reset() for that purpose but is their a way I can invoke that method
without doing so in the actionclass? ie. would seem logical for such access
to the reset() to be linked in with standard handling of the html:form

Cheers,
Blinky

"Michael" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> what's all the numbers for?
>
> reset() is needed cause the form object is construted once
> per session and reused.  you need a default object state
> before the  is posted by the actionservlet into the ActionForm.
> it's a (re)intializer.
>
>
> -Original Message-
> From: Struts Newsgroup [mailto:@[EMAIL PROTECTED]]
> Sent: Saturday, March 16, 2002 6:55 PM
> To: [EMAIL PROTECTED]
> Subject: reset() on ActionForm ???
>
>
> Subject: reset() on ActionForm 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 

Re: Upload: java.io.IOException: Multipart data doesn't start with boundary

2002-03-17 Thread Peter Hunter

Have you set your form to be the right type? Specifically, does it have 
enctype="multipart/form-data" in the  tag?

Cheers,

Peter

On Friday, March 15, 2002, at 01:04 AM, Matt Raible wrote:

> I'm trying to do the following:
>
> Add a new file using an UploadForm and UploadAction.add method.  This
> works fine.
>
> Update the properties of this file using the same UploadForm and
> UploadAction.save method. After saving the information to the database,
> I leave the form in it's scope (session) and forward it to the
> UploadAction.edit method - which retrieves the record from the database.
>
> However, when I forward back to the UploadAction.edit (using
> /do/upload?action=Edit), I get the following error:
>
> Any ideas?
>
> Matt
>
> - Root Cause -
> java.io.IOException: Multipart data doesn't start with boundary
>   at
> org.apache.struts.upload.MultipartBoundaryInputStream.readFirstElement(M
> ultipartBoundaryInputStream.java:348)
>   at
> org.apache.struts.upload.MultipartBoundaryInputStream.setInputStream(Mul
> tipartBoundaryInputStream.java:172)
>   at
> org.apache.struts.upload.MultipartIterator.parseRequest(MultipartIterato
> r.java:202)
>   at
> org.apache.struts.upload.MultipartIterator.(MultipartIterator.java
> :171)
>   at
> org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskM
> ultipartRequestHandler.java:75)
>   at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:908)
>   at
> org.apache.struts.action.RequestProcessor.processPopulate(RequestProcess
> or.java:793)
>   at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
> 246)
>   at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109)
>   at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:470)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>   at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
> her.java:679)
>   at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp
> atcher.java:431)
>   at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat
> cher.java:355)
>   at
> org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProc
> essor.java:181)
>
>
>
> --
> To unsubscribe, e-mail:    [EMAIL PROTECTED]>
> For additional commands, e-mail:  [EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Cannot find ActionMappings or ActionFormBeans collection

2002-03-17 Thread Frank Marx


Hi,

I have the same problem. But it worked before in JB5 now with Forte for
JAVA 4.0 EAP it doesn't work anymore even I use the same
struts-config.xml and don't even define a data source.

I think the Action-Servlet looks for the struts-config.xml in the wrong
place but I'm not 100% sure.

Here is my struts-config.xml:



http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>






 




 



  

  









  





  

  









  





  

  

  
  



















  






Can someone help please it makes no sense to me anymore.

Thanks in advance,

Frank Marx

PS: I can execute jsp - pages which are using struts-Tags but no one
with form-tags and actions.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: ActionMappings or ActionFormBeans collection cannot be found ???

2002-03-17 Thread Frank Marx

Hi,

sorry but something went wrong with my posting.
Anyway I know now that the javax.xml.parsers.FactoryConfigurationError:
com.sun.xml.parser.SAXParserFactoryImpl is the cause of my problem. But
I don't know how to solve it.

Is use JDK1.4 SE on Windows 2000 prof. edition.

Maybe you have an idea how to proceed ?

Frank

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: ActionMappings or ActionFormBeans collection cannot be found ???

2002-03-17 Thread Frank Marx

Hi,

sorry I don't know what this is , but SUN recommends that you use JDK1.4
with FORTE so I did that and there is the problem :-(.




Frank

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: When i have three buttons that all can submit the same form...

2002-03-17 Thread Nguyen, Khuong
Create an action to act like a controller for the CRUD pattern with search.
Your form would have a mode attribute that the controller checks and do
chain action or forwarding accordingly for each mode.Your 3 buttons would
have type submit, name=mode, and value=Seach, Delete, Create ... Your
controller then retrieve any data from the backend before routing to the
search, create,edit,delete,view screen or actions.

-Original Message-
From: nsg [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 14, 2002 8:18 PM
To: Struts Users Mailing List
Subject: When i have three buttons that all can submit the same form...


the three button are: Search, Add,Delete. i set the Search button as
submit
type.the other two are button type.

when i want to click Add(or Delete) to submit the form, i should change
the
form's action and then submit using JavaScript?

Are there any method else to do that except using JavaScript in Struts
framework?


Thanks in advance.


Laker

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


[Struts / Template] Problems including a "*.do".

2002-03-17 Thread Sam Chia

Hi,

  I am driven crazy using Struts Template and trying to include a path to a
"*.do" instead of
"*.jsp". Please help me as I am stuck in this issue for so long. Really
drives me cuckoo!!


A template file 
--
<%@ page contentType="text/html"%>
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>



DisplayForm Template



  
  
  




-

The file that calls the template:
-
<%@ page contentType="text/html"%>
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ page buffer="100k" autoFlush="true" %>


Form Display


  



-

Error
---
javax.servlet.jsp.JspException: Error in servlet
at org.apache.struts.taglib.template.GetTag.doStartTag(GetTag.java:193)
at
_pages._template._displayformtemplate._jspService(displayformtemplate.jsp:12
)
[/pages/template/displayformtemplate.jsp]
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:192)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:356)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:306)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Oracle9iAS (2.0.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.j
ava:667)
at com.evermind[Oracle9iAS (2.0.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.
java:108)
at com.evermind[Oracle9iAS (2.0.0.0) Containers for
J2EE].server.http.EvermindPageContext.include(EvermindPageContext.java:284)
at org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:145)
at _pages._displayform._jspService(displayform.jsp:14)
[SRC:/pages/displayform.jsp]
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:192)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:356)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:306)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Oracle9iAS (2.0.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.j
ava:667)
at com.evermind[Oracle9iAS (2.0.0.0) Containers for
J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDis
patcher.java:269)
at com.evermind[Oracle9iAS (2.0.0.0) Containers for
J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:
704)
at com.evermind[Oracle9iAS (2.0.0.0) Containers for
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:250)
at com.evermind[Oracle9iAS (2.0.0.0) Containers for
J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:62)




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Redirecting to login page when session expires

2002-03-17 Thread Tony Li

What's the most elegant way of redirecting the user to the login page
after his session expires within struts?

Thanks,

Tony Li

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Calling EJB's in struts

2002-03-17 Thread sanjeev_dutt


Hi,

Could someone point me to a document which talks about calling EJB's in the struts 
framework.

Thanks
Sanjeev

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: setting 'selected' in html:select

2002-03-17 Thread Jim Crossley

Set the formbean attribute that corresponds to the "property" value of
the enclosing  tag.  If the value exists in the nested options
somewhere, then the  tag will automatically add the "selected"
attribute to the html output.

This is normally done in the action class prior to forwarding to your
view.

Struts Newsgroup (@Basebeans.com) <[EMAIL PROTECTED]> writes:

> Subject: setting 'selected' in html:select
> From: "blinky" <[EMAIL PROTECTED]>
>  ===
> This may seem a really basic question but can anyone show me how to preset a
> value as selected in a struts  tag???
> 
> In the old 'cruddy' raw jsp world I'd loop through the collection until
> finding the preset value and stick 'selected' into the option tag that
> matched.
> 
> Seems I can't do that when using  property="value" labelProperty="label"> - though I was expecting some neater
> way would exist to handle it anyway??
> 
> Do I need to have another property in 'mybean' called 'selected' with
> getters/setters
> Or do I somehow preset the selection on the htm:select tag???.
> 
> Any help much appreciated
> 
> Regards,
> Blinky
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

-- 
Jim Crossley
http://www.lads.com/~jim

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Redirecting to login page when session expires

2002-03-17 Thread Jim Crossley

Hi Tony.

"Tony Li" <[EMAIL PROTECTED]> writes:

> What's the most elegant way of redirecting the user to the login page
> after his session expires within struts?

Here's a simple approach:

Override the ActionServlet's perform method to check the session for
something that your login action should've put there.  If it's there,
return super.perform().  If it's not, return findForward("login"),
assuming you have a global forward in your struts-config called
"login". 

A more elegant approach might involve the use of a filter (Servlet
2.3) instead of an ActionServlet derivation, but the idea of "looking
in the session for something indicating a successful login" is the
same.

-- 
Jim Crossley
http://www.lads.com/~jim

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Domain Validation

2002-03-17 Thread chad brak

Nevermind my last question pertaining to domain
validation. I answered my own question by extending
ActionServlet and then
overriding the processValidate method.


- Original Message -
From: "chad brak" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 1:13 PM
Subject: Domain Validation


> Can anybody tell me the best way to do domain
> validation in 1.0? Form validation is great, but I
> need a central place for more standard validation
> stuff.
>
> Chad


__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




setparameter

2002-03-17 Thread @Basebeans.com

Subject: setparameter
From: Vic Cekvenich <[EMAIL PROTECTED]>
 ===
I need to implement setparameter(string,string), opposite of 
getParameter(string).
Can you suggest how?
tia,
Vic


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Calling EJB's in struts

2002-03-17 Thread Jay sissom

What do you need to know?

In the perform method of your action object, get the data you need from 
the form object passed to it, then create an reference to an EJB, call 
your business logic in your EJB, then handle the response.

If you need info about how to call EJB's, I'm sure there are mailing lists 
about EJB's that can help.

Jay

On Sun, 17 Mar 2002, sanjeev_dutt wrote:

> 
> Hi,
> 
> Could someone point me to a document which talks about calling EJB's in the struts 
>framework.
> 
> Thanks
> Sanjeev
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: nested:iterate - set method not called

2002-03-17 Thread Arron Bates

The setter on a nested property, such as the list properties in my 
example, is only there as a convenience. The Struts managing code will 
never actually use it. It only worries about the last bean in the nested 
property definition. My construtors use it to make the simple example 
easier to do.

As for storing a reference to the form bean in all the shild beans... 
no. This is probably not model behaviour. I only did it so I could get 
my delete buttons working for the banana objects. The setter of the 
banana's object knows that the bean is to be deleted as it's been 
called. The reference to the parent bean is there so it can call the 
parent bean and tell it that it wants to be deleted.

If you don't need this more advanced bean driven functionality, then you 
really should avoid it.

Arron.


Elijah Jacobs wrote:

>Thanks for the reply Arron, ... well appreciated.
>
>but I noticed in your example that the MonkeyBean contains an ArrayList of
>monkeys  (ArrayList monkeyList) and you have both a setter and a getter
>method for it.  I was trying to duplicate this on my form bean.  My
>ArrayList is contained in the FormBean itself. That's why I was expecting
>the setter method in the formbean to be called.
>
>Also, is it necessary for the beans contained in my ArrayList to a reference
>to the form, much like you have a reference to the BananasIncorporatedBean
>from the MonkeyTeamBean.
>
>I apologize if these are simple question, I've struggle with this for 2 days
>now and the project deadline is not budging.
>
>- ej
>
>- Original Message -
>From: "Arron Bates" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Sent: Sunday, March 10, 2002 8:04 PM
>Subject: Re: nested:iterate - set method not called
>
>
>>The getter will only ever be called, as it's the middle-man.
>>The system only wants to set the "name" property on the nested bean. It
>>will call the getter of the "extrainfo" object to get at the nested
>>bean, and then set its property. Never actually calling the setter of
>>the parent bean property.
>>
>>Arron.
>>
>>
>>Elijah Jacobs wrote:
>>
>>>thanks for the reply, Scott
>>>
>>>
>>>My syntax looks okay on the jsp side and since the getExtrainfo method is
>>>being called it puzzles me that the set method is not being called on
>>>submit.
>>>
>>> 
>>>
>>>
>>>- ej
>>>- Original Message -
>>>From: "Barr, Scott [IBM GSA]" <[EMAIL PROTECTED]>
>>>To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
>>>Sent: Sunday, March 10, 2002 7:03 PM
>>>Subject: RE: nested:iterate - set method not called
>>>
>>>
Could it be that the html field in your jsp is named 'extraInfo'

>>>(uppercase
>>>
'i'), and the setter is using a lowercase 'i' in the word info?

Scott

>-Original Message-
>From: Elijah Jacobs [SMTP:[EMAIL PROTECTED]]
>Sent: Monday, March 11, 2002 10:27 AM
>To: Struts Users Mailing List
>Subject: nested:iterate -  set method not called
>
>Hi,
>
>I am able to list the elements on  my Vector just fine, but I noticed
>
>>>that
>>>
>when I do a submit the set method is not being called, hence the field
>
>>>is
>>>
>empty when it gets to the action class.
>
>Can someone suggest to me what the problem might be? my code is below.
>
>thanks,
>- ej
>
>*** code 
>public Vector extrainfo;
>
>// call successfully
>public Object[] getExtrainfo() {...}
>
>//Not being called on submit
>public void setExtrainfo(Object[] infoList) {...}
>
>*** code 
>
>
>--
>To unsubscribe, e-mail:
>
>For additional commands, e-mail:
>
>
--
To unsubscribe, e-mail:

>>>
>>>
For additional commands, e-mail:

>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>>
>
>
>>>For additional commands, e-mail:
>>>
>
>
>>>
>>
>>
>>--
>>To unsubscribe, e-mail:
>>
>
>
>>For additional commands, e-mail:
>>
>
>
>>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: problem with bean having session scope

2002-03-17 Thread Slimane

THANX A LOT Joe !!! :)

All my problems with session scope beans are now resolved :)

So what was exactly the problem ? (it could be usefull to others, I guess)

Well, to instantiate my beans, I always put the following line in my jsp files:


But, as Joe wrote :
>This is just a shot in the dark...but perhaps the explicit creation you
>are specifying by the  tag is screwing up Strut's management of
>the ActionForm bean?  In any case, you don't need to use the 
>tag at all for ActionForm beans, as Struts takes care of instantiating,

And indeed, that seemed to be the main problem !

So, thanx again Joe, for your patience and all your help :)

Friendly Regards,
Slimane

PS: pfiou, I'm happy that problem is finally resolved :)

At 02:27 16/03/2002 +0100, Someone poor demented soul by the name of 
"Slimane" presented us with the following text which may contain useless 
information.
>okay, thanx a lot for your help :)
>
>I'll try the second method tomorrow (now it's 2am and I'm feeling sleepy :)
>
>Friendly Regards,
>Slimane
>
>At 17:02 15/03/2002 -0800, Someone poor demented soul by the name of 
>"Joseph Barefoot" presented us with the following text which may contain 
>useless information.
>>Yep, that's what I meant, mis-type on my part there.  hmmm...so you want 3
>>ActionForm beans to be instantiated when a single Action is delegated to,
>>but don't want to use nested forms?
>>
>>Okay, you can do this two (maybe more) ways:
>>
>>1.  You could chain your actionforwards such that the Action called forwards
>>to a second Action, the second Action forwards to a 3rd, etc., and thus your
>>ActionForms get instantiated.  The final Action in the chain then forwards
>>to whatever page you wanted the user to see.
>>
>>2.  The Action (call it Action A) that is called when it's associated URI is
>>requested explicitly creates whatever ActionForms you want and initializes
>>them with setXXX methods.  Then Action A places these form beans into the
>>HTTPRequest object as attributes with the SAME NAME that struts would use
>>for the attribute, i.e. the logical name specified in the action-mapping for
>>the form bean.  Then, when subsequent URI's are requested associated with
>>other Actions, if Struts finds that an attribute with the associated (with
>>the particular Action) form bean's logical name already exists, it will use
>>that object rather than instantiating a new one (I'm pretty sure that's how
>>it works).  The only drawback is that you would have to make sure that
>>Action A's URI is requested BEFORE the other Actions' URIs, so that your
>>logic will initialize and store the ActionForm beans rather than the Struts
>>framework.
>>
>>whew.  I don't know if that helps, but it's the best I could come up with
>>based on what I know about Struts.  :)
>>
>>A final consideration:  Is is possible that 2 of the 3 beans don't need to
>>be ActionForm beans at all, but just value objects that are created and
>>stored in the session?
>>
>>
>>-Original Message-
>>From: Slimane [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, March 15, 2002 3:49 PM
>>To: Struts Users Mailing List
>>Subject: RE: problem with bean having session scope
>>
>>
>>Hi,
>>
>>Thanx again for your answer :)
>>
>>The problem is that I don't want to nest my ActionForm, I want them all
>>treated as a unique session bean. Without them being into (dependant of)
>>another ActionForm.
>>
>> >so you can retrieve them from other Actions/JSPs by
>> >using request.getAttribute(  ).
>>
>>I suppose you meant request.getSession().getAttribute( >name> ), didn't you ? :)
>>
>>Friendly Regards,
>>Slimane
>>
>>At 15:12 15/03/2002 -0800, Someone poor demented soul by the name of
>>"Joseph Barefoot" presented us with the following text which may contain
>>useless information.
>> >Valid questions, all. :)  I have to admit I'm not 100% sure when the
>> >ActionForm bean is first instantiated/initialized, but this is what I
>>think:
>> >The ActionForm bean is created and initialized when the URI specified by
>>the
>> >action-mapping for this particular Action/ActionForm pair is requested.
>> >(if this is incorrect, please someone correct me)
>> >
>> >If you want to share beans, just declare the scope to be "session" for the
>> >bean in question in the action-mapping for this action inside
>> >struts-config.xml.  Struts stores these beans as attributes in the
>> >HTTPSession object, so you can retrieve them from other Actions/JSPs by
>> >using request.getAttribute(  ).
>> >
>> >As for the last question, ActionForm beans can appear as fields inside
>>other
>> >ActionForms, so you can nest your form beans such that when one gets
>> >instantiated, all of the nested form fields get instantiated too.  Then you
>> >can reference them as nested attributes of the parent ActionForm inside any
>> >of your Struts JSP tags.  You can also retrieve them from the session in a
>> >similar manner:
>> >
>> >request.getAttribute(  ).getMyNestedForm()
>> >
>> >happy coding,
>> >
>> >Joe
>> >
>>

Validator Problem

2002-03-17 Thread Barry Glasco



Environment: Weblogic 6.1. sp2 

Jsp tag: 

<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> 
<%@ taglib uri="/WEB-INF/tlds/struts-validator.tld" prefix="validator" %> 
 



   


 



ERROR MESSAGE: 

   <[WebAppServletContext(6657758,veh 
-web,/veh-web)] Root cause of ServletException 
javax.servlet.jsp.JspException: (line 19): no handler for tagname='errorsExist' 
at org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:1 
49) 
at jsp_servlet.__department._jspService(__department.java:274) 
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) 
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm 
pl.java:265) 
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm 
pl.java:304) 
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm 
pl.java:200) 
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe 
rvletContext.java:2495) 
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm 
pl.java:2204) 
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139) 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: nested:iterate - set method not called

2002-03-17 Thread Elijah Jacobs

thanks, Arron

that cleared things up.

- ej

- Original Message -
From: "Arron Bates" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, March 17, 2002 10:55 AM
Subject: Re: nested:iterate - set method not called


> The setter on a nested property, such as the list properties in my
> example, is only there as a convenience. The Struts managing code will
> never actually use it. It only worries about the last bean in the nested
> property definition. My construtors use it to make the simple example
> easier to do.
>
> As for storing a reference to the form bean in all the shild beans...
> no. This is probably not model behaviour. I only did it so I could get
> my delete buttons working for the banana objects. The setter of the
> banana's object knows that the bean is to be deleted as it's been
> called. The reference to the parent bean is there so it can call the
> parent bean and tell it that it wants to be deleted.
>
> If you don't need this more advanced bean driven functionality, then you
> really should avoid it.
>
> Arron.
>
>
> Elijah Jacobs wrote:
>
> >Thanks for the reply Arron, ... well appreciated.
> >
> >but I noticed in your example that the MonkeyBean contains an ArrayList
of
> >monkeys  (ArrayList monkeyList) and you have both a setter and a getter
> >method for it.  I was trying to duplicate this on my form bean.  My
> >ArrayList is contained in the FormBean itself. That's why I was expecting
> >the setter method in the formbean to be called.
> >
> >Also, is it necessary for the beans contained in my ArrayList to a
reference
> >to the form, much like you have a reference to the
BananasIncorporatedBean
> >from the MonkeyTeamBean.
> >
> >I apologize if these are simple question, I've struggle with this for 2
days
> >now and the project deadline is not budging.
> >
> >- ej
> >
> >- Original Message -
> >From: "Arron Bates" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Sent: Sunday, March 10, 2002 8:04 PM
> >Subject: Re: nested:iterate - set method not called
> >
> >
> >>The getter will only ever be called, as it's the middle-man.
> >>The system only wants to set the "name" property on the nested bean. It
> >>will call the getter of the "extrainfo" object to get at the nested
> >>bean, and then set its property. Never actually calling the setter of
> >>the parent bean property.
> >>
> >>Arron.
> >>
> >>
> >>Elijah Jacobs wrote:
> >>
> >>>thanks for the reply, Scott
> >>>
> >>>
> >>>My syntax looks okay on the jsp side and since the getExtrainfo method
is
> >>>being called it puzzles me that the set method is not being called on
> >>>submit.
> >>>
> >>> 
> >>>
> >>>
> >>>- ej
> >>>- Original Message -
> >>>From: "Barr, Scott [IBM GSA]" <[EMAIL PROTECTED]>
> >>>To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> >>>Sent: Sunday, March 10, 2002 7:03 PM
> >>>Subject: RE: nested:iterate - set method not called
> >>>
> >>>
> Could it be that the html field in your jsp is named 'extraInfo'
> 
> >>>(uppercase
> >>>
> 'i'), and the setter is using a lowercase 'i' in the word info?
> 
> Scott
> 
> >-Original Message-
> >From: Elijah Jacobs [SMTP:[EMAIL PROTECTED]]
> >Sent: Monday, March 11, 2002 10:27 AM
> >To: Struts Users Mailing List
> >Subject: nested:iterate -  set method not called
> >
> >Hi,
> >
> >I am able to list the elements on  my Vector just fine, but I noticed
> >
> >>>that
> >>>
> >when I do a submit the set method is not being called, hence the
field
> >
> >>>is
> >>>
> >empty when it gets to the action class.
> >
> >Can someone suggest to me what the problem might be? my code is
below.
> >
> >thanks,
> >- ej
> >
> >*** code 
> >public Vector extrainfo;
> >
> >// call successfully
> >public Object[] getExtrainfo() {...}
> >
> >//Not being called on submit
> >public void setExtrainfo(Object[] infoList) {...}
> >
> >*** code 
> >
> >
> >--
> >To unsubscribe, e-mail:
> >
> >For additional commands, e-mail:
> >
> >
> --
> To unsubscribe, e-mail:
> 
> >>>
> >>>
> For additional commands, e-mail:
> 
> >>>
> >>>
> >>>--
> >>>To unsubscribe, e-mail:
> >>>
> >
> >
> >>>For additional commands, e-mail:
> >>>
> >
> >
> >>>
> >>
> >>
> >>--
> >>To unsubscribe, e-mail:
> >>
> >
> >
> >>For additional commands, e-mail:
> >>
> >
> >
> >>
> >
> >--
> >To unsubscribe, e-mail:

> >For additional commands, e-mail:

> >
> >
>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:


Bean:define and NullPointerException!

2002-03-17 Thread Marcelo Caldas

Hi guys,

Here's the problem... All my JSP files were working properly until I had to download a 
new version of struts for the support of nested tags...

Now, what is happening is that all mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: 




Re: setparameter

2002-03-17 Thread Mikael Eriksson

Hi

If you mean getParameter() in the request you should be looking
at the getAttribute and setAttribute methods to (hopefully) get
what you want.

  Regards
  Mikael


At 07:25 2002-03-17 -0800, you wrote:
>Subject: setparameter
>From: Vic Cekvenich <[EMAIL PROTECTED]>
>  ===
>I need to implement setparameter(string,string), opposite of
>getParameter(string).
>Can you suggest how?
>tia,
>Vic
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: and tags - both are being exec uted!

2002-03-17 Thread Jesse Alexander (KADA 12)

Hi,

realizing its own defects is the first step for bettering oneself...

Do not assume that those who give smart answers always were that smart.
Others also started with questions like yours and then "have grown up"...

So just be happy it works now.

regards
Alexander

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Donnerstag, 14. März 2002 18:52
To: [EMAIL PROTECTED]
Subject: RE:  and  tags - both are
being exec uted!


I am soo sorry!  I have been wasting your time.  All this time I have
been having problems with these logic tags - but only because I forgot to
import the structs-logic.tld file!!!  :oS

I have been constructing my JSPs from the structs-example JSPs and they
don't use the logic tags, but I should have spotted this.  

Well - now it all works so I'm happy.  But not happy about being such a
dumb-ass newbie.  : (

Lindsay

 -Original Message-
From:   Jin Bal [mailto:[EMAIL PROTECTED]] 
Sent:   14 March 2002 17:41
To: Struts Users Mailing List
Subject:Re:  and  tags - both are
being exec uted!

You could try changing the logic that sets the myAgents Vector into the
session to either set the list or set a zero length list rather than
null...just a thought.  Try explicitly setting the scope in your bean write
tag
HTH  ;-)

Jin
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 14, 2002 5:20 PM
Subject: RE:  and  tags - both are being
exec uted!


> OK I've overcame this problem by (reluctantly) using
>
> <% if (session.getAttribute("myAgentsVector") == null ) { %>
> . display static html 
> <% } else { %>
> . logic:iterate thru the Vector and bean:write each element's
properties
> into a table 
> <% } %>
>
> But I keep getting an error message
> "Cannot find bean agent in scope null"
> where the bean 'agent' is the id given in the logic:iterate tag.
>
> By default - this bean will have page scope, so by using the default
> bean:write tag - it should be located.
>
> Here's the key tags that are causing this:
>
>  type="zeus.generator.web.model.object.Agent" scope="session">
> 
> 
> 
> 
>
>
> Oh I hope I don't need to begin yet another new subject thread!  : (
>
> Cheers.
>
> Lindsay
>
>  -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 14 March 2002 16:18
> To: [EMAIL PROTECTED]
> Subject:  and  tags - both are being
> exec uted!
>
> Hi,
>
> I have an action class (HomeAction) that sets a session attribute (can I
> call this a bean!?) which is a java.util.Vector of my own custom Agent
> objects.  This attribute is only set if the Vector, created by the action
> class, is not empty.
>
> Anyway - eventually the HomeAction class will forward to home.jsp which is
> where I want to present this Vector in a table.  At present, this Vector
is
> always empty and so the HomeAction class will NOT add it to the session.
>
> Before I continue - here is the troublesome JSP code:
>
>
>  type="java.util.Vector">
> <% System.out.println("Did not find session attribute myAgentsVector.
User
> has no agents"); %>
>   
>  
> 
>   You currently have no agents.
> 
>   
> 
>
>  type="java.util.Vector">
> <% System.out.println("Found session attribute myAgentsVector.  Creating
> dynamic My Agents table"); %>
> 
>type="zeus.generator.web.model.object.Agent" scope="page">
>   <% System.out.println("Created a bean called agent - from
> myAgentsVector"); %>
> 
>   "
> bordercolor="#CC"> 
>   
>   
> (v)
>   /td>
>   To be defined (using Struts)
> 
>   
> 
> 
>
>
> I'd expect only the body of the  tag to be executed, but
> for some reason the  tag's body is also being executed.
Here
> is the console output to show it:
>
>
> 2002-03-14 16:08:30 - Ctx(/struts-SACT) : Compiling: /home.jsp to home_13
> Did not find session attribute myAgentsVector.  User has no agents
> Found session attribute myAgentsVector.  Creating dydnamic My Agents table
> Created a bean called agent - from myAgentsVector
> 2002-03-14 16:08:32 - Ctx(/struts-SACT) : Exception in R( /struts-SACT +
> /home.jsp + null) - javax.servlet.ServletException: Cannot find bean agent
> in scope null
>
>
>
> Do any of you wise people (   =oS   )  have any idea what I'm doing wrong
in
> this code.
>
> Many many thanks,
>
> Lindsay
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Need help with JspException: Missing message for key login.ti tle

2002-03-17 Thread Jesse Alexander (KADA 12)

not necessarily. make sure that you have your applications classes and struts 
available within one class-loader. Either use the web-application classloader
(WEB-INF/lib, WEB-INF/classes and maybe other dirs configurable) or use
the system-classloader (eg. under wls, jrun) or the shared classloader under
Tomcat.

Or modify the struts-code exchanging every forName(className) with
forName(className,true,Thred.currentThread().getContextClassLoader())
Then you can have the classes in different class-loaders...

hth
Alexander

-Original Message-
From: keithBacon [mailto:[EMAIL PROTECTED]]
Sent: Mittwoch, 13. März 2002 14:51
To: Struts Users Mailing List
Subject: Re: Need help with JspException: Missing message for key
login.title


not sure but might be one of those where your struts.jar is in the wrong place.
Make sure it is in your web app's WEB-INF/lib & nowhere else where the server
could find it (ie. not on your system or server classpath).


--- Alok Kumar <[EMAIL PROTECTED]> wrote:
> YOu should put one more line in Applicationproperties file that is 
> login.title=some text ouyt here
> 
> Alok
> 
> - Original Message -
> From: [EMAIL PROTECTED]
> Date: Wednesday, March 13, 2002 4:24 pm
> Subject: Need help with JspException: Missing message for key 
> login.title
> 
> > Hi everyone,
> > 
> > I've just began using Struts this week and it seems very useful, 
> > but I am
> > totally lost for ideas when it comes to this exception:
> > 
> > "Exception in R( /struts-SACT + /login.jsp + null) -
> > javax.servlet.ServletException: Missing message for key login.title"
> > 
> > I have placed my ApplicationResources.properties in the /classes 
> > directoryand here's the relevant part of web.xml:
> > 
> > 
> >  action
> >   > class>org.apache.struts.action.ActionServlet
> >  
> > application
> > ApplicationResources
> >  
> >  .
> > 
> > 
> > Here's my ApplicationResources.properties (it is very simple at 
> > present -
> > which makes this error all the more annoying):
> > 
> > error.username.required=Username is required
> > error.password.required=Password is required
> > error.database.unknown=Sorry, an unknown database error occurred
> > errors.footer=
> > errors.header=Validation 
> > ErrorYou must
> > correct the following error(s) before proceeding:
> > login.title=SME Agent Creation Tool - User Login
> > prompt.login.username=Username
> > prompt.login.password=Password
> > 
> > 
> > And here's a part of my login.jsp:
> > 
> > <%@ page language="java" %>
> > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> > 
> > 
> >  
> > 
> > 
> > I heard that this is a common problem and that I should look at 
> > the mailing
> > list archive, but I find no help there at all.
> > 
> > Many thanks for any input.
> > 
> > Lindsay
> > 
> > 
> > 
> > Lindsay Hamoudi
> > Web Application Developer
> > BTexact Technologies
> > 
> > e-mail: [EMAIL PROTECTED]
> > tel: (+44) (0)1473 605491
> > mobile: (+44) (0)7985 114296
> > 
> > Orion Building (B62-MH), PostPoint 12, Adastral Park, Martlesham, 
> > IpswichIP5 3RE, UK
> > 
> > 
> >BTexact Technologies is a trademark of British Telecommunications
> > plc
> >Registered office: 81 Newgate Street London EC1A 7AJ 
> >Registered in England no. 180 
> >This electronic message contains information from British
> > Telecommunications plc which may be privileged or confidential. The
> > information is intended to be for the use of the individual(s) or 
> > entitynamed above. If you are not the intended recipient be aware 
> > that any
> > disclosure, copying, distribution or use of the contents of this 
> > informationis prohibited. If you have received this electronic 
> > message in error, please
> > notify us by telephone or email (to the numbers or address above)
> > immediately.
> > 
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:    > [EMAIL PROTECTED]>For additional commands, e-mail: 
> > 
> > 
> > 
> 
> > **Disclaimer
>   
> 
> 
> Information contained in this E-MAIL being proprietary to Wipro Limited
> is 'privileged' and 'confidential' and intended for use only by the
> individual or entity to which it is addressed. You are notified that any
> use, copying or dissemination of the information contained in the E-MAIL
> in any manner whatsoever is strictly prohibited.
> 
> 
> 
>  
> 
> > --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 


=
~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~
Keith Bacon - Looking for struts work - South-East 

about getting data from Hashtable

2002-03-17 Thread Laker,Nan
Hi all,
How can I get data from hashtable by keys values sort ?


Thanks in advance.


Laker


Struts and XML data islands

2002-03-17 Thread Rich Jones

Hello,

Has anyone used Struts with XML data islands?  I have a requirement to use data 
islands, and would like to use Struts as the framework.  From what I've seen, a jsp 
page would invoke a method that would return an XML stream, and then use the xml tag 
to render the data.  My initial thought was to have a wrapper object around the XML 
(obtained via my Action subclass), and then have that object available when I forward 
to the response jsp.

I'd appreciate any thoughts, opinions, direction, etc.

Thanks.



Re: Validator Problem

2002-03-17 Thread David Winterfeldt

These tags were deprecated for a while and when the
Validator was repackaged under
org.apache.struts.validator they weren't moved over
since there are the equivalent tags in Struts.  So
they might not be there depending on what version of
the Validator you are using.

validator:errorsExist --> logic:messagesExist
validator:errors --> html:messages

If you download a release before the last one
(1/14/2002), the tags are still there.  
   http://home.earthlink.net/~dwinterfeldt

David

--- Barry Glasco <[EMAIL PROTECTED]> wrote:
> 
> 
> Environment: Weblogic 6.1. sp2 
> 
> Jsp tag: 
> 
> <%@ taglib uri="/WEB-INF/tlds/struts-html.tld"
> prefix="html" %> 
> <%@ taglib uri="/WEB-INF/tlds/struts-validator.tld"
> prefix="validator" %> 
>  
> 
> 
> 
>
> 
> 
>  
> 
> 
> 
> ERROR MESSAGE: 
> 
>   
> <[WebAppServletContext(6657758,veh 
> -web,/veh-web)] Root cause of ServletException 
> javax.servlet.jsp.JspException: (line 19): no
> handler for tagname='errorsExist' 
> at
>
org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:1
> 
> 49) 
> at
>
jsp_servlet.__department._jspService(__department.java:274)
> 
> at
>
weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
> 
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> 
> pl.java:265) 
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> 
> pl.java:304) 
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> 
> pl.java:200) 
> at
>
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
> 
> rvletContext.java:2495) 
> at
>
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
> 
> pl.java:2204) 
> at
>
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Matt - this if for you...

2002-03-17 Thread Keith Chew

Hi Matt

Recall this problem that we discussed a while back? Well, I had a bit more
of a play in the weekend. I discovered that if you use the SSL extension,
the multiple forwards of *.do will not work. Well, it works in a very weird
way, basically only chosing one .do to forward. Try it out sometime if you
can. I think one of the problems come from the SLL extension switching the
request between secure and non-secure.

I am currently working on an alternative to including multiple *.do, which
will then make the application work on Tomcat as well as SSL extensions.

This is just a note to you it case you strike the same problem in the
future.

Keith



-Original Message-
From: Keith Chew [mailto:[EMAIL PROTECTED]]
Sent: Monday, 11 March 2002 9:26 a.m.
To: Struts Users Mailing List
Subject: RE: design flaw if using a template...


Hi Matt

I have done more research over the weekend and this is what I have found:

The multiple *.do only works in Resin, not Tomcat. In Tomcat, this is the
exception:

"javax.servlet.jsp.JspException: Cannot forward after response has been
committed"

Further investigation shows that Tomcat is calling flushBuffer() after the
first forward. Resin handles this differently, as shown in this post I
found:



-Original Message-
From: Andreas Junghans [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 22, 2002 1:09 AM
To: Tomcat Developers List
Cc: [EMAIL PROTECTED]
Subject: Re: HttpServletResponseWrapper error.


Hi Jay,

> This works with Resin. However, in Tomcat, when I wrap the response, I
> "commit" the original response object and can not forward to a thank you
> page. I catch a "java.lang.IllegalStateException: Cannot forward after
> response has been committed". In my debug tests, the response is committed
> during the RequestDispatchers forward method.

I've had a similar case. The problem is that Tomcat calls flushBuffer() on
the response, which seems to be completely "legal" regarding the Servlet
spec. Calling flushBuffer() commits the response, and after that, no forward
is possible.

If Resin behaves differently, this is probably due to a different buffer
size or different buffer handling. Perhaps Resin doesn't call flushBuffer()
at all, which (in my understanding) is just as spec compliant as Tomcat's
behaviour.

What you have to do is override flushBuffer() in your response wrapper to
prevent HttpServletResponseWrapper from passing the flush to the original
response. In my case, I simply added an empty flushBuffer() method to the
wrapper, and it worked. However, you should note that some containers
_might_ rely on the side effects of the original flushBuffer() (e.g. that
exceptions are raised when calling methods like sendRedirect() afterwards).
Although this is highly unlikely, you have to "simulate" these effects in
your wrapper if you want to be _absolutely_ sure your application runs in
every container.

Regards

  Andreas Junghans




I have tried the latest version of Tomcat 4.0.3, but no joy.

Keith




-Original Message-
From: Matt Read [mailto:[EMAIL PROTECTED]]
Sent: Friday, 8 March 2002 11:04 a.m.
To: Struts Users Mailing List
Subject: RE: design flaw if using a template...


I'm glad you've found a solution. I'd still say you're misusing
 though, because it's not really a template that you're
inserting but if it works, it works.

-Original Message-
From: Keith Chew [mailto:[EMAIL PROTECTED]]
Sent: 07 March 2002 21:15
To: Struts Users Mailing List
Subject: RE: design flaw if using a template...


Hi Matt

I am such an idiot.

In my template.jsp, I have:



This is equivalent to a jsp include. My mistake was news.do forwards to
new.jsp after getting the data from the database.

However, news.jsp uses template.jsp too!! So it's trying to go into an
infinite loop!

I have changed new.jsp to just return the news. It's going well.

Thank you very much for all you help.

Keith



-Original Message-
From: Matt Read [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 7 March 2002 3:31 p.m.
To: Struts Users Mailing List
Subject: RE: design flaw if using a template...


Keith, they're not the same thing, by any means. As you said, if you use
your method:

you get a "too many servlet includes `/template.jsp'" error. This is doesn't
really suprise me at all - you're basically trying to use something which
blatantly isn't a template, as a template.

However if you use the method I outlined in my examples, i.e. you "put"
content into a template, whether this content is a .jsp or an action mapping
url - it works.

Honestly, just use  as it is documented and your problems will
be solved.

Matt.

-Original Message-
From: Keith Chew [mailto:[EMAIL PROTECTED]]
Sent: 07 March 2002 02:18
To: Struts Users Mailing List
Subject: RE: design flaw if using a template...


H

how to call getter method with parameter?

2002-03-17 Thread I Wayan Saryada

Hi All,
 
I have a problem like this, I have a session variable I defined like:
 

 
after defining it I would like to call the getAttribute method of the sess
variable;
if in scriptless way we call it session.getAttribute("USER"); how can we do
it
in struts :
 
 where I should pass the
"USER" string
into the getAttribute method?
 
Thanks,
-wayan-




actionerrors not showing up

2002-03-17 Thread Steven Dahlin

I am not getting any errors showing up with the jsp page.  I have the
following action code:

public class UserAction extends Action
{
  public ActionForward perform( ActionMapping   actMap,
   ActionFormactFrm,
   HttpServletRequest  hsReq,
   HttpServletResponse hsRsp )
throws  IOException,
ServletException
   {

  ActionErrors errors  = new ActionErrors();

   /* code of no consequence */

  ActionError actErr = new ActionError( "an error message" );

  errors.add( ActionErrors.GLOBAL_ERROR, actErr );

  saveErrors( hsReq, errors );

  return ( new ActionForward( actMap.getInput() ) );

   }
}


Then the jsp that is called looks for the errors with the tag:

   

but no errors appear.  Can anyone tell me what I am doing wrong?

Thanks,
Steve

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Announce: Struts training during Java One on 3/28 at Marriott

2002-03-17 Thread @Basebeans.com

Subject: Announce: Struts training during Java One on 3/28 at Marriott
From: Vic Cekvenich <[EMAIL PROTECTED]>
 ===
1. Struts training during Java One on 3/28 at Marriott.
For more information or to register go to StrutsPlus.com. 25 people have 
already registered.

2. New news groups for your news reader are added to StrutsPlus.com, 
including Tomcat, Soap, fop, Jakarta, mySQL. They join struts, 
postgreSQL and Netbeans. No need to filter the messages.

3. Now on StrutsPlus.com/news.jsp we have a daily Java news, if you want 
to KIT on Java, check daily.

4. StrutsPlus/Downloads page has a full Struts DB sample, trainPIM (on 
bottom of the download page) that does CRUD, master/detail, tiles, 
validation, menu, etc. It is the only Struts DB demo I know of.
  It will be soon replaced by webPIM (on top of download page) that will 
delegate DAO, dispatch actions, do drop down, format, etc. This version 
is incomplete still. But with a separated DAO, it is easy to do EJBs if 
you'd like.

I hope to see you on 3/28. You will like this new version of the Struts 
presentation.
PO's are OK, and discount for groups.

Thanks,
Vic

Ps:
Soon, I will post a Struts e-book, explaining how to build a sample 
Struts DB application at StrutsPlus.com/book.jsp



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Problem with Tomcat (4) and session id's

2002-03-17 Thread mike . witt

This question may apply to more than just Struts, but since I'm using
 I'll ask it here first.  

Using html:link, I'm supplying a href parameter to another webapp within my
Tomcat 4 server.  However, when I click on the link, my session id is
replaced by a new session id.  Therefore, I can't find things, like my user
object.  I am doing an encodeURL within the html:link, but this doesn't seem
to help.  If anyone knows how I can keep my old session id, I'd really
appreciate.  BTW, Tomcat 4 is my development environment.  The production
environment is on iPlanet, which doesn't seem to have this problem.

Thanks for any help.

Mike Witt


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Use of tags

2002-03-17 Thread Vikram Goyal01

Hi all,

Is using Stuts tags (for that matter using any tags) a performance hit?
The reason I ask this is because of the fact that for even normal tags which are 
defined by the HTML specs, we replace them with Stuts tags. For e.g.  is 
replaced by . Isnt this an overkill and a performance problem as this 
simple tag also has to get compiled and loaded, when the browser could handle it on 
its own?

Rgs
Vikram

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Newbie :Error- Cannot find ActionMappings or ActionFormBeans

2002-03-17 Thread Anant Sagar

Yes you are right ,as i spent quite a good time in figuring out the reason
for this problem. The same code was working till a day before and suddenly
the next day throwing exception led me look at the 30 days trial driver
which i was using .I changed the system date and everything worked.

Coming back to keith's  question.
The error was thrown in struts code. As i was calling login.jsp the program
was executing just before the form tag. and gave that error msg on console.


upto here execued properly



a part of struts-config.xml looks like this for login form

 

 
 

login.jsp is a simple jsp with username and password .and LoginForm is a
also a simple bean with get and set methos .After loading and  on submit i m
calling LoginAction which then access database for the first time .
In this scenario what do you suggest where should i  handle exception.

Thanks
Anant Sagar.

From: "keithBacon" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 6:32 PM
Subject: Re: Newbie :Error- Cannot find ActionMappings or ActionFormBeans


> Was the error thrown in struts code or your code?
> The code probably needs proper exception handling. Misleading error
messages
> are bad news.
>
> --- Anant Sagar <[EMAIL PROTECTED]> wrote:
> > Dear All ,
> > The problem was coming due to the expiry of my JSQLConnect driver. Its
quite
> > weird in the sense that the error msg was irrelevant .
> > Any way thanks
> > Anant Sagar
> > - Original Message -
> > From: "keithBacon" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Saturday, March 16, 2002 4:57 PM
> > Subject: Re: Newbie :Error- Cannot find ActionMappings or
ActionFormBeans
> >
> >
> > > This can be a bit tricky - did you search the Archive?
> > >
> > > --- Anant Sagar <[EMAIL PROTECTED]> wrote:
> > > > Hello All ,
> > > >
> > > > I m new to struts . I had prepared my login page .It was working
fine
> > > > .Suddenly this exception is coming
> > > >
> > > > javax.servlet.ServletException: Cannot find ActionMappings or
> > ActionFormBeans
> > > > collection
> > > > javax.servlet.jsp.JspException: Cannot find ActionMappings or
> > ActionFormBeans
> > > > collection
> > > >
> > > > Can anybody let me know what could be the reason for the above
> > exception.
> > > >
> > > > Anant Sagar
> > > >
> > >
> > >
> > > =
> > > ~~
> > > Search the archive:-
> > > http://www.mail-archive.com/struts-user%40jakarta.apache.org/
> > > ~~
> > > Keith Bacon - Looking for struts work - South-East UK.
> > > phone UK 07960 011275
> > >
> > > __
> > > Do You Yahoo!?
> > > Yahoo! Sports - live college hoops coverage
> > > http://sports.yahoo.com/
> > >
> > > --
> > > To unsubscribe, e-mail:
> > 
> > > For additional commands, e-mail:
> > 
> >
> >
> > --
> > To unsubscribe, e-mail:

> > For additional commands, e-mail:

> >
>
>
> =
> ~~
> Search the archive:-
> http://www.mail-archive.com/struts-user%40jakarta.apache.org/
> ~~
> Keith Bacon - Looking for struts work - South-East UK.
> phone UK 07960 011275
>
> __
> Do You Yahoo!?
> Yahoo! Sports - live college hoops coverage
> http://sports.yahoo.com/
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




is applicationresources.properties being found?

2002-03-17 Thread Steven Dahlin

How do I know if the application has found the properties file?  I have a
file of the right name in the right place (WEB-INF/classes) and yet the
 tag returns "null null" with no message in between.  I know
that I have created a message of the right description.  Do any of the
tomcat log files indicate that the properties file has been found?

Also, were is there proper documentation on all the possibilities in the
web.xml.  I have hunted all throughout all the docs I could find at the
jakarta website but could not find anything?

Thanks,
Steve

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Parameterized redirect (rephrased)

2002-03-17 Thread @Basebeans.com

Subject: Re: Parameterized redirect (rephrased)
From: "Tea Yu" <[EMAIL PROTECTED]>
 ===
Hi...

Maybe I should refactor my problem..

I'd like to do a parameterized redirect from childAction to
/do/parent/View which anticipates a formBean (or request parameters
equivalently), which I guess I must achieve by passing a session bean, if
I'm not appending request parameters to the URL.

However, my question is:  if my users should be able to reload
/do/parent/View, then I must not remove the session bean or they'll
probably get lost.  But that's even worse than rewriting the URL.  If this
is the case, shall struts consider to incorporate methods for us to do
parameterized forward/redirect?

I really appreciate if anyone could give me an idea.  Or tell me if I've
missed out something...

Thanks and regards
Tea

> Hi again,
>
> I've browsed through the archive but I'm a little bit confused...  I'd
> really appreciate if anyone could give me some hints on this:
>
> [ /do/parent/View?id=999 ]
> John Leave home
>
> After deleting an entry by following any of these links, I'd like to
> redirect the user to /do/parent/View?id=999 again.  *Since I'd like to
> prohibit my user to do intended listing reload but end up in
resubmitting
> the deletion again.
>
> So what I do was to put the parent bean into session after deletion and
> refer my user to /do/parent/View and in the actionForm:
>
> if ("View"){
> if(request.getAttribute("parent") != null) {
> get parent bean in request scope
> } else if (session.getAttribute("parent") != null) {
> get parent bean in session scope
> **remove parent bean in session scope
> } else {
> populate parent bean from formBean
> }
>
> But it ends up that I see nothing by reloading the result page again
since
> I've removed the bean from the session scope
>
> Anyone come with a better solution or suggestions at which point should
I
> handle this:
>
> * allow resubmitting deletion with transaction measure by token, thus do
> forwarding with request scope parent bean
> ** delay the removal of session bean (but when..)
>
> Really thanks for your help!
>
> Tea Yu



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: setting 'selected' in html:select

2002-03-17 Thread @Basebeans.com

Subject: Re: setting 'selected' in html:select
From: "blinky" <[EMAIL PROTECTED]>
 ===
Jim,

Only question then is whether I could  invoke the action class prior to
initial display of the view (ie. view jsp is the first thing thats
displayed). I do have a servlet that fires initially for the entire
application but its running in application context.

I've since got around this by setting the actionform property as you said
but doing  it inside constructor of the actionform itself . I think this
means when the jsp is very first displayed it creates the actionform and so
sets the property

Thanks for your help.

Regards,
Blinky

"Jim Crossley" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Set the formbean attribute that corresponds to the "property" value of
> the enclosing  tag.  If the value exists in the nested options
> somewhere, then the  tag will automatically add the "selected"
> attribute to the html output.
>
> This is normally done in the action class prior to forwarding to your
> view.
>




--
To unsubscribe, e-mail:   
For additional commands, e-mail: