Fortune Telling Collection - Horoscope - How to write a program about constellation with JSP?
How to write a program about constellation with JSP?
Import java.io. *; Import javax.servlet. *; Import javax.servlet.http. *; Import java.util. *; The public class xingzuo extends httpservlet {public void doget (httpservlet request req, HttpServletResponse res) and throws ioexception {res.set content type ("text/html"); RES . setcharacterencoding(" GB 23 12 "); PrintWriter out = RES . getwriter(); string get month = req . getparameter(" month "); Int month = new integer (getmonth). int value(); string getday = req . getparameter(" day "); Int day = new integer (getday). int value(); string test = req . getparameter(" t 1 "); Boolean err = falseint xingzuo number = 0;; int fenjie[]={2 1, 19,2 1,2 1,22,22,23,24,24,23,22 }; int zuida[]={3 1,29,3 1,30,3 1,30,3 1,30,3 1,30,3 1 }; String xingzoo[]= {"Aquarius", "Pisces", "Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius" and "Goat"}; String xing ge[]= new String[ 12]; Xingge[0]= "This constellation is usually called' Genius Constellation' or' Future Constellation'." ; Brother Xing [7]= "Virgo is characterized by rich knowledge and meticulous work"; Xingge[8]= "Librans love beauty and harmony, and they are also quite kind and compassionate,"; Brother Xing [9]= "People in this constellation have a strong sixth sense, mysterious visiting ability and attraction,"; Brother Xing [10]= "People born in this constellation advocate freedom, freedom and speed,"; Brother Xing [1 1]= "Like a goat walking on a precipice, steady and practical." ; out . print(" & lt; html”); out . print(" & lt; body bgcolor = # 3300 ff "); out . print(" & lt; Center "); if(zuida[month- 1]& lt; day){ err = true; }; if(day = fenjie[month- 1]){ xingzuo number =(month % 12)+ 1; } else { xingzuonumber = month}; If (err) {out.print ("The birthday you entered is wrong, please re-enter"); } else { out . print(" & lt; Table border =1"+"< tr”); out . print(" & lt; TD”); out . print(" & lt; img src = 'image/"+ xingzuonumber +"。 jpg ' & lt/TD”); out . print(" & lt; TD”); Out.print ("Your birthday is"+month+"month"+day+"day"+"Your constellation is"+constellation [(constellation number+10)% 12]+ "The characteristics of this constellation are:"+constellation [(constellation). Font color = red & ltahref = xingzuo.jsp Click to return to the home page "); }//out . print(xingzuo[0]); out . print(" & lt; /tr & lt; /table & lt; /center”); out . print(" & lt; /body”); out . print(" & lt; /html "); } }
- Related articles
- What constellation was born on February 3rd?
- What's so interesting about Gemini and Aquarius playing together?
- Sun sign lion moon sign Gemini rising sign in Aquarius.
- What is the constellation on May 23rd of the lunar calendar _ What is the constellation on May 23rd of the lunar calendar?
- These constellation women like to buy all kinds of green plants best.
- No matter which constellation, the daily water supply is very small.
- The top 5 of the fairy face value constellation
- Is rising Scorpio a bad girl?
- Men's Wang career WeChat avatar yoga photo
- Constellation query software is free.