| |

VerySource

 Forgot password?
 Register
Search
View: 736|Reply: 9

Drop-down list box problem

[Copy link]

3

Threads

12

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-1-26 14:20:01
| Show all posts |Read mode
<SELECT name = "ywy" size = "1">
   <c: forEach var = "ywyList" items = "$ {ywyArr}">
   <OPTION value = "$ {ywyList}"> $ {ywyList} </ OPTION>
   </ c: forEach>
</ SELECT>
------------------
Take the value from ywyArr, display the drop-down list box in jsp, and output in servlet are all Chinese. How to display garbled characters like com.hy.YwyBean@db5b3f in jsp?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-17 12:00:02
| Show all posts
You use jsf, what you output is not garbled, but an object of your com.hy.YwyBean.
Reply

Use magic Report

3

Threads

12

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

 Author| Post time: 2020-2-17 16:00:02
| Show all posts
How to make him appear in Chinese?
Reply

Use magic Report

0

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 Invalid IP Address

Post time: 2020-2-23 17:30:02
| Show all posts
Your ywyList is an object. The direct output object in JSTL will call the toString () method by default, but if you use JDO or Hibernate, this default call seems to be problematic. What is the suggestion that you use this object Just write the attribute. For example, if there is a name attribute in ywyList and you want to output it, then the above statement should be written as
<SELECT name = "ywy" size = "1">
   <c: forEach var = "ywyList" items = "$ {ywyArr}">
   <OPTION value = "$ {ywyList.name}"> $ {ywyList.name} </ OPTION>
   </ c: forEach>
</ SELECT>
Reply

Use magic Report

3

Threads

12

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

 Author| Post time: 2020-3-6 16:30:01
| Show all posts
Still not working, dizzy.
Reply

Use magic Report

0

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 Invalid IP Address

Post time: 2020-3-8 00:30:01
| Show all posts
Why not
Reply

Use magic Report

3

Threads

12

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

 Author| Post time: 2020-3-8 13:15:01
| Show all posts
Or com.hy.YwyBean@db5b3f
Reply

Use magic Report

3

Threads

12

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

 Author| Post time: 2020-3-8 15:00:01
| Show all posts
The modified one also corresponds to Bean.
  <SELECT name = "ywy" size = "1">
   <c: forEach var = "ywyArr" items = "$ {ywyArr}">
   <OPTION value = "$ {ywyArr.dzyname}"> $ {ywyArr.dzyname} </ OPTION>
   </ c: forEach>
   </ SELECT>
Reply

Use magic Report

0

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 Invalid IP Address

Post time: 2020-3-18 21:00:02
| Show all posts
dzyname Is this also an object?
Reply

Use magic Report

3

Threads

12

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

 Author| Post time: 2020-3-24 12:45:01
| Show all posts
No, dzyname is a property of YwyBean.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list