No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Vous devez être membre et vous identifier pour publier un article.
Les visiteurs peuvent toutefois commenter chaque article par une réponse.

[Struts] Récupérer les paramètres de la requête

Astuces de l’Infobrol (Java)Article publié le 16/01/2007 13:53:14


  1. StringBuilder str = new StringBuilder("Test : ");
  2. Enumeration e = httpservletrequest.getParameterNames();
  3. while(e.hasMoreElements()){
  4. String name = (String)e.nextElement();
  5. String[]vals = httpservletrequest.getParameterValues(name);
  6. str.append("\n"+name+" : ");
  7. for(int j = 0;j‹vals.length;j++){
  8. str.append(vals[j]);
  9. if(i‹vals.length-1) str.append(", ");
  10. }
  11. }


Avatar :: Steph Un article de Steph

Source : indéterminée


Commenter l'article

Commentaires


06/02/2007 13:30:15

J'ai mis le code et il refuse de compiler

- bobo -


06/02/2007 14:20:34

C'est un problème au moment du parcing du code.
Il confond l'index [ i ] avec le bbcode italic, et il supprime le bachslashe d'échappement de retour à la ligne dans \n.
Je corrige le code (je remplace i par j) et je chercherais à résoudre ce problème plus tard ;-)

Sinon, tu peux utiliser le code sans problème, il donne le résultat voulu.


- Steph -

Sélection, tri et recherche d'articles
FILTRER :
TRIER :1er critère : 2e critère :
CHERCHER : Dans les titres Dans le contenu


[Afficher les liens en fonction des critères du formulaire ci-dessus]

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 13/09/2004, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/ast-rf-377.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.