Free Essay

Term

In:

Submitted By loveanil
Words 1247
Pages 5
LOVELY PROFESSIONAL UNIVERSITY

HOME WORK – I
DOA: 9/7/2012 DoS: 9/17/2012

-------------------------------------------------------------------------------------------------------------------

Assignment

COURSE- Modern Web Programming Tools and Techniques-I

COURSE CODE- CAP618T

SUBMITTED BY: SUBMITTED TO:

Anil Kumar Miss. MANDEEP KAUR

Roll-A24

Reg. - 11013165

Sec- D1R05

Q: 1 Take a JavaBeans Object named “Profession” with properties domain and expertise. Show the use of all 4 scope types on this object.

Ans:- You just need to create a domain object as a JavaBeans property and the corresponding getter and setter methods.

The framework will automatically initialize the domain object and transfers the form data. The UserAction class contains the following code.

Public class UserAction extends ActionSupport

{

Private User user;

Public UserAction()

{

Public String execute()

{

Return SUCCESS;

}

Public User getUser()

{

Return user;

}

Public void setUser(User user)

{

this. user=user;

}

}

To refer the user attributes like name, age etc. we need to first get the user object and then access its properties. For example to access the user's age in the Action you need to use the following syntax.

getUser().getAge();

public class User { private String name; private int age; private String sex; private String[] hobby; private String country; public String getName() { return name;
}
public void setName(String name) { this.name = name;
}
public int getAge() { return age;
}

public void setAge(int age) { this.age = age;
}

public String getSex() { return sex;
}

public void setSex(String sex) { this.sex = sex;
}
public String[] getHobby() { return hobby;
}

public void setHobby(String[] hobby) { this.hobby = hobby;
}

public String getCountry() { return country;
}

public void setCountry(String country) { this.country = country;
}
}
In the jsp page the user attributes cannot be directly referenced. Since the attributes we refer in the jsp page belongs to the User object we need to go one level deeper to reference the attributes. To refer the user's age, the value of the name attribute should be

name="user.age"

Scope is the idea that an object belongs to a certain part of an application. The five main scopes of a web application are request, response, page, session, and application. This means that an object may be a part of a request, a response, an individual page, a session, or an instance of the application. For example, if we said, "the employee object has session scope," we would mean that the employee object only existed within a certain session.

Page Count = Session count = Application count = Time =

[5]

Q: 2 discuss and demonstrate the use of all page directive attributes. Give minimum 2 separate types of examples for each attribute, to make it clear that how that attribute is effecting output.

Ans: - The page directive is used to provide instructions to the container that pertain to the current JSP page. You may code page directives anywhere in your JSP page. By convention, page directives are coded at the top of the JSP page.
Following is the basic syntax of page directive:

You can write XML equivalent of the above syntax as follows:

Attributes:
Following is the list of attributes associated with page directive:

|Attribute |Purpose |
|buffer |Specifies a buffering model for the output stream. |
|autoFlush |Controls the behavior of the servlet output buffer. |
|contentType |Defines the character encoding scheme. |
|errorPage |Defines the URL of another JSP that reports on Java unchecked runtime exceptions. |
|isErrorPage |Indicates if this JSP page is a URL specified by another JSP page's errorPage attribute. |
|extends |Specifies a superclass that the generated servlet must extend |
|import |Specifies a list of packages or classes for use in the JSP as the Java import statement does for |
| |Java classes. |
|info |Defines a string that can be accessed with the servlet's getServletInfo() method. |
|isThreadSafe |Defines the threading model for the generated servlet. |
|language |Defines the programming language used in the JSP page. |
|session |Specifies whether or not the JSP page participates in HTTP sessions |
|isELIgnored |Specifies whether or not EL expression within the JSP page will be ignored. |
|isScriptingEnabled |Determines if scripting elements are allowed for use. |

The buffer Attribute:

The buffer attribute specifies buffering characteristics for the server output response object.
You may code a value of "none" to specify no buffering so that all servlet output is immediately directed to the response object or you may code a maximum buffer size in kilobytes, which directs the servlet to write to the buffer before writing to the response object.
To direct the servlet to write output directly to the response output object, use the following:

Use the following to direct the servlet to write output to a buffer of size not less than 8 kilobytes:

The autoFlush Attribute:

The autoFlush attribute specifies whether buffered output should be flushed automatically when the buffer is filled, or whether an exception should be raised to indicate buffer overflow.
A value of true (default) indicates automatic buffer flushing and a value of false throws an exception.
The following directive causes the servlet to throw an exception when the servlet's output buffer is full:

This directive causes the servlet to flush the output buffer when full:

Usually, the buffer and autoFlush attributes are coded on a single page directive as follows:

The contentType Attribute:

The contentType attribute sets the character encoding for the JSP page and for the generated response page. The default content type is text/html, which is the standard content type for HTML pages.
If you want to write out XML from your JSP, use the following page directive:

The following statement directs the browser to render the generated page as HTML:

The following directive sets the content type as a Microsoft Word document:

You can also specify the character encoding for the response. For example, if you wanted to specify that the resulting page that is returned to the browser uses ISO Latin 1, you would use the following page directive:

The errorPage Attribute:

The errorPage attribute tells the JSP engine which page to display if there is an error while the current page runs. The value of the errorPage attribute is a relative URL.
The following directive displays MyErrorPage.jsp when all uncaught exceptions are thrown:

The isErrorPage Attribute:

The isErrorPage attribute indicates that the current JSP can be used as the error page for another JSP.
The value of isErrorPage is either true or false. The default value of the isErrorPage attribute is false.
For example, the handleError.jsp sets the isErrorPage option to true because it is supposed to handle errors:

The extends Attribute:

The extends attribute specifies a superclass that the generated servlet must extend.
For example, the following directive directs the JSP translator to generate the servlet such that the servlet extends somePackage.SomeClass:

The import Attribute:

The import attribute serves the same function as, and behaves like, the Java import statement. The value for the import option is the name of the package you want to import.
To import java.sql.*, use the following page directive:

To import multiple packages you can specify them separated by comma as follows:

By default, a container automatically imports java.lang.*, javax.servlet.*, javax.servlet.jsp.*, and javax.servlet.http.*.

The info Attribute:

The info attribute lets you provide a description of the JSP. The following is a coding example:

The isThreadSafe Attribute:

The isThreadSafe option marks a page as being thread-safe. By default, all JSPs are considered thread-safe. If you set the isThreadSafe option to false, the JSP engine makes sure that only one thread at a time is executing your JSP.
The following page directive sets the isThreadSafe option to false:

Similar Documents

Premium Essay

Long Term Short Term Financing

...Long-Term Short-Term Financing Gwen Florence University of Phoenix June 19, 2012 Long-Term Short-Term Financing Both new and established businesses will find it necessary to incur debts during the course of business operations. Financing may be sought for a multitude of reasons – like smoothing cash flow, purchasing equipment, or expanding operations. The choice between short- and long-term financing options should be determined based on each business’ individual needs. To make that determination, businesses also need to understand when each type of financing is appropriate. For financing needs over a period of a year or less, sort term financing can be used to inject capital into businesses (Ross, Thompson, Christensen, Westerfield, Jordan, 2001). Short term financing options include short-term loans, letters of credit, promissory notes, over drafting, and inventory loans. These options are often used by businesses to cover day-to-day costs like supplies, inventory orders, and wages. Due to the nature of their shifting demands, seasonal businesses in particular often use short term finance arrangements. An example of short-term financing is a company signing a short-term loan in order to purchase more inventories. Proceeds from sales of goods would be used to repay the loan. This is appropriate only if the capital required by the firm can be paid off within the loan’s timeframe. For financing needs over a longer...

Words: 353 - Pages: 2

Premium Essay

Term Paper

...develop ethical and environmental guidelines for the sourcing of its coffee beans. Starbucks is committed to enhancing and providing an excellent work environment for its employees and partners are treated with respect and dignity. Starbucks, founded in 1985, by Howard Shultz has achieved an impressive rate of growth in earning per share of 20% per year for the past decade. The company has witnessed steady revenue growth in this time period, in spite of overall economic downturns. In addition, an impressive growth rate in store openings and success in maintaining the profitability of current operations. Starbucks has demonstrated its ability to grow steadily and responsibly. Although short term margins have tightened as a result of this aggressive expansion, its long term growth projections show promising growth in retail locations, steady sales growth at existing locations, and a continuously expanding product line that differentiate it from the competition and keep its customers coming back. Starbucks’ ability to combat the risks and external threats that it faces from world economic factors, competitive forces come from its solid brand image, and its dedication to continual product innovation and the quality services that it offers its customers prove it to be a worthy investment. The financial analysis of the company also provides us with more than ample reason to purchase Starbucks stock. Through our analysis using the SWOT Model, we’ve found that Starbucks...

Words: 328 - Pages: 2

Premium Essay

Planning Shor Term and Long Term

...technological era, there are softwares that can help people carry out their budget planning. Firstly, it is important to make mental and physical note on your current expenses and then think critically on every penny that is spent. Next, one has to create the budget for the current month observing the expenses done in the previous step. Lastly, proper plans on how to spend need to be made with the help of online planning budget and it can help in the business as well as for the family expenses. There are two budgeting terms. One is long term budgeting other one is short term budgeting. Long term budgeting is looking at the future in order to know what the market needs.Short-term budgeting involves making budgets that is short-term, such as inventory purchases, over-time costs, marketing and one-off expenses such as cash purchases of equipment or buildings. Long term planning are usually used by companies and short term planning are usually used by individuals. Long term budgeting is making decision for more than one year. The company first look at the environment, internal and external factors and then how much profit the company...

Words: 761 - Pages: 4

Premium Essay

Long Term and Short Term Financing

...Long-Term and Short-Term Financing FIN/200 November 19, 2010 David Stretton Long-Term and Short-Term Financing All business owners make profit but they also acquire debt in the process of making money. In order to make money as a business owner you have to spend money to be successful. So, in order for a business to stay afloat the business owners may decide to purchase big ticket items that they really do not have the on hand revenue for. In order for a business owner to purchase these items or even expand the business they must decide what type of financing they need to do so. Depending on the businesses needs they could either choose to go with long-term financing or short-term financing. If a business owner wants to finance something for a shorter period of time like one year or less, then it is best for them to go with short-term financing. Short-term financing really depends on what the business owner needs the loan for. The options for short-term financing could include a line of credit, a note, pledging receivables, or even factoring (Block, Hirt, Danielsen, 2009). One example of a business owner using short-term financing would be to purchase inventory for the next year. Long-term financing is done when a business owner needs a bigger amount of money and they want to pay it back in a longer period than just one year. The long-term financing options could be a term loan, preferred stock equity, or even a secured or unsecured loan (Block, Hirt, Danielsen...

Words: 319 - Pages: 2

Premium Essay

Term Paper

...I am determined to beat the odds.  I will not become another negative statistic.  I desire to become a positively contributing citizen that aides in making my surroundings a better place.  To accomplish this, there are personal goals that I have established for myself. There are several goals that I am currently working towards.  However, my short term goals have always remained simple. I am working to maintain an overall A average in the classes that I am enrolled in.  This leads to me successfully completing high school.  After  graduating from high school, I will begin studying at a college that best fits my educational needs.  My long term goals deal with my future in general. After the completion of high school, I plan to attend an accredited university where I will obtain degree in Biochemistry with a pre-dental concentration. I will become a well rounded student just as I am in high school. I also plan to run for freshman class president, not only that I also look forward to joining many prestigious organizations around the campus. I aim to complete an internship that will give me additional skills and tools that will allow me to excel in my graduate studies.  I plan to finish undergraduate studies with a grade point average of 3.5 or higher.  This will assist in me getting accepted into a school of dentistry. Being that getting accepted into dental school is so competitive, I plan to work extremely hard to prepare myself to take the Dental Acceptance Test my junior year...

Words: 513 - Pages: 3

Premium Essay

Short Term and Long Term Goals

...Deciding when Short-term or Long-term Goals Drive a Decision Rickey Paradise GEN480 MAY 09, 2013 Professor Annie Debeljak University of Phoenix Deciding when Short-term or Long-term Goals Drive a Decision To determine the difference in short-term and long-term decisions one must understand that most decisions have both. As a planner and estimator making difficult decisions is a daily occurrence. The decisions made today effect the long-term decisions because the goal may change, such as making a schedule to complete a task. The long term estimated delivery of the product may be six months away. However, the short-term goals and decisions to achieve the goal effect the scheduled date because bottlenecks occur, such as retrieving the parts to complete the task on time. Personal goals have the same consequences. Planning his or her education is a one way to understand this concept. If an individual makes a decision to obtain his or her degree in two years the long-term goal is set. However, during the course of the year a tragedy occurs and the individual has to change the long-term goal because the short-term goals are affected. Critical thinking while setting the goal may have solved the problem. Allowing for inconvenient occurrences while setting the long-term goal helps to maintain the set schedule. Setting goals require making small steps to obtain the long-range goal. Monitoring the short-term goals is one way to achieve the long-term goal. According to Rosen L...

Words: 400 - Pages: 2

Free Essay

Term Paper

... They want to asses if the spread of technology would become a distraction or a help to a student. The investigators were appealed to the topic because gadgets are now able to provide easier access to information and educational advantages. Gadgets get the attention of the students because of its engrossing and fascinating presentations of information. This also helps the parents who are unaware of the effects of gadgets to their child’s study. Overuse of gadgets may result to interference with the student determination and ability to learn. Technology can be used for many things some positive and some negative. The effects that are now being documented on children whom are left unattended for hours on end are nothing but negative. Long term damage is more prevalent in the recent studies than ever before. Researchers are finding that many parents are using the internet and other form of technology to “raise” their children. Thus...

Words: 2595 - Pages: 11

Premium Essay

Term

...23rd Psalm             The Lord is my Shepherd;             I shall not want.             In verdant pastures He gives             me repose;             Before restful waters He leads             me; He refreshes my soul.             He guides me in right paths for             His name's sake.             Even though I walk in the dark             valley I fear no evil;                 for you are at my side, with your             rod and your staff that give me             courage.             You spread a table for me in the             sight of my foes; you anoint my             head with oil; my cup overflows.             Only goodness and kindness             follow me all the days of my life;             And I shall dwell in the house of             the Lord for years to come. Family Prayer             God made us a family.             We need one another.             We love one another.             We forgive one another.             We work together.             We play together.             We worship together.             Together we use God's word.             Together we grow in Christ.             Together we love all people.             Together we serve our God.             Together we hope for heaven.             These are our hopes and ideals.             Help us to attain them,             O God, through Jesus Christ our Lord.   Motherhood             O glorious Saint Gerard,             powerful intercessor before ...

Words: 1510 - Pages: 7

Premium Essay

Setting the Short-Term and Long-Term Goals for Newlyweds

...Setting the Short-term and Long-term Goals for Newlyweds It is important for the newlyweds to have a financial plans set up as it helps them have a focus in life and have a reason for saving money. The short-term goals would involve things that would not require a lot of money and thus would be achieved in a short time. The long-term goals on the other hand would entail things that require a lot of money to accomplish and thereby take more time to complete (McKeown, 2012). Short-term Goals The first short term goal that I would advise the couple to set is improving the outlook of their house. This would include buying equipment that they do not have but they need them. These items include things such as furniture and electrical appliances. They would do a research on the prices of the gadgets in the market and thereby be able to note the specific target in terms of money. They would then set the amount that they should save monthly towards the furniture and electrical appliances (Hallman & Rosenbloom, 2003). The couple should also target at clearing all their financial debts. They should set aside a specific sum of money monthly to pay these debts. After clearing their debts they should then save up money, which they can use, in case they face a financial problem. This would help them avoid getting into debts in the future (Hallman & Rosenbloom, 2003). They should also save for their annual vacation. This should be done throughout the years since each year they...

Words: 634 - Pages: 3

Premium Essay

Short Term Decisions

...5 Short-term Decision Making 5.1 Introduction and objectives Previous chapters have focused on the nature of costs and how they behave in relation to changes in activity and over time. The nature of costs is an important factor to consider in decision making. Types of decisions are usually split into short and long-term. Chapter 14 (Capital Investment Appraisal) considers the longer-term decision-making process, whilst this chapter focuses on the short-term. After studying this chapter you will be able to: „„ Understand costs that are relevant to the decision-making process in different circumstances „„ Demonstrate working knowledge of typical short-term decisions managers have to make and how financial data can support these decisions „„ Recognise the issues of managing scarce recourses in decision making; and „„ Appreciate the implications of outsourcing in a business context. 5.2 Relevant costs in decision making Relevant costing is a management accounting term and relates to focusing on only the costs relevant to a specific decision being made. It simplifies the decision-making process as it ignores cost data that is ‘irrelevant’, or will not have an impact on the specific decision being made. When making a particular decision-relevant costs are those that may change, depending on the decision taken. Relevant costing is often used in short-term decision making and a number of specific practical examples are illustrated later in this chapter. A typical decision...

Words: 1147 - Pages: 5

Premium Essay

Short Term Financing

...CHAPTER: SHORT TERM FINANCING Topics to be Covered: 1. Meaning and nature of short-term financing. 2. Sources of Short Term Financing. 3. Advantages of Short-Term Financing. 4. Disadvantages of Short Term financing. 5. Purpose of Short-Term Financing. 6. “Ideal Concept” of Short-Term Financing. 7. What is Trade Credit? 8. Reasons for the use of Trade Credit. 9. Factors determining the amount of Trade Credit used 10. Cost of Trade Credit 11. Who bears the cost of Trade Credit? 12. What is Bank Credit? 13. Distinction between Bank Credit and Short Term credit. 14. Characteristics of Short Term financing Meaning and nature of short-term financing: Short Term financing is that from of financing which embraces borrowing or lending of funds for a short period of time. It refers to the finance obtained on short term basis, usually one year or less in duration. Short term finance is secured for financing the current assets, for example, inventories. Short term finance is also known as working capital which is the excess of current assets over current liabilities. Current liabilities become due within one year and indicate the amount of short-term credit being utilized by the business. Practically all enterprises use the short-term credit as sources of finance. We find in the balance sheets of almost all the companies some kinds of current liabilities which are the indicator of...

Words: 2541 - Pages: 11

Premium Essay

Capitalism for the Long Term

...84 Harvard Business Review March 2011 HBR.ORG Dominic Barton is the global managing director of McKinsey & Company. Long Term Business leaders face a choice: They can reform the system, or watch as the government exerts control. A call to action from McKinsey & Company’s global managing director by Dominic Barton Capitalism for the T ILLUSTRATION: JAMES JOYCE he near meltdown of the nancial system and the ensuing Great Recession have been, and will remain, the de ning issue for the current generation of executives. Now that the worst seems to be behind us, it’s tempting to feel deep relief—and a strong desire to return to the comfort of business as usual. But that is simply not an option. In the past three years we’ve already seen a dramatic acceleration in the shifting balance of power between the developed West and the emerging East, a rise in populist politics and social stresses in a number of countries, and significant strains on global governance systems. As the fallout from the crisis continues, we’re likely to see increased geopolitical rivalries, new international security challenges, and rising tensions from trade, migration, and resource competition. For business leaders, however, the most consequential outcome of the crisis is the challenge to capitalism itself. That challenge did not just arise in the wake of the Great Recession. Recall that trust in business hit historically low levels more than a decade ago. But the crisis and the surge in...

Words: 4956 - Pages: 20

Premium Essay

Long Term Goals

...According to the dictionary a Goal is a person's ambition or effort to achieve something. Everyone has a goal to accomplish whether it's a long term goal or short term goal. Long term goals take 12 months or more to achieve and short term goals take 12 months or less. Long term goals are harder to achieve than short term. My goals are definitely long term rather than short term goals. My goals are to get accepted into Virginia Tech, to play on Tech’s lacrosse team, and have a house next to a ski resort. First, I want to get accepted to go to Virginia Tech. I want to go there because it is my favorite school and my aunt went there. To get accepted I have to work harder and longer on my grades. I got to get every homework, project, and essay in on time. Its most popular majors are engineering, business, and management. I want to major in engineering because I want to learn how to build and fix things. If I have a problem with something I would be able to fix it. Getting accepted to Virginia Tech would help me later in life with problems....

Words: 489 - Pages: 2

Premium Essay

Short-Term Objectives

...Executive Summary The corporate level strategy of Dish Network is to horizontally integrate. It acquired Blockbuster and tries to maintain this studio right. Also, it purchased additional wireless licensures to implement this strategy. The business level option of Dish Network is to integrate Dish products into Blockbuster stores. In the long run, Dish Network should try to work on retaining the current customers and gain more customers as well. At the same time, it will build a good reputation to be competitive in today's television market. The ultimately purpose of any commercial organization is to maximize profit, but this should build upon being achieved these short-term objectives. Short-Term Objectives In the coming six months, Dish Network will develop the following short-term objectives: 1. Try to increase the market shares. According to the Dish Network annual report, the corporate has 13.967 million subscribers until December 31, 2011, which represent approximately 14% of pay-TV subscribers in the United States. In the first season this year, Dish has increased its customer group by 22,000. Therefore, Dish Network can keep trying to retain the existing customers and increase the potential customers to gain more market shares. With the current customer’s base, the corporate can set having 13.997 million subscribers as a goal, which means increase approximately 0.21% of the market shares in the second quarter. 2. Promote the Hopper DVR. Dish Network launched this...

Words: 782 - Pages: 4

Premium Essay

Medical Term Project

...Jacob Snyder 11/17/2014 Medical Terminology Course Project A.) Term # | Page of article/paragraph | Medical Term | Breakdown | Translation | 1. | 19/1 | Cardiovascular | Cardi/o- HeartVascular-Vessels | Relating to the vessels in the heart | 2. | 20/2 | Hematocrit | Hemat/o-BloodCrit-Judge | Instrument used to judge or gauge blood | 3. | 20/2 | Hemoglobin | Hem/o-BloodGlobin-protein | Proteins in the blood | 4. | 20/5 | Rectal | Rect-RectumAl-Pertaining to | Pertaining to the rectum | 5. | 20/5 | Respiratory | Respir/a-RespirationTory-Relating to | Relating to respiration | 6. | 20-6 | Spirometry | Spir/o- To breatheMetry- act of measuring | To measure breathe | 7. | 21-2 | Stethoscope | Steth/o-chestScope-View | Device for viewing sounds inside the chest | 8. | 21-2 | Brachial | Brach/i- ArmAl-Relating to | Relating to the arm | 9. | 26-4 | Thermoregulatory | Therm/o-HeatRegulatory-Regulation | Regulation of the body’s heat | 10 | 26-5 | Cardiopulmonary | Cardi/o-HeartPulm/o-LungsNary-Pertaining to | Pertaining to the heart and lungs | 11. | 26-6 | Metabolic | Meta-to changeBolic- to throw | To exchange and throw broken down chemicals throughout the body | 12. | 27-3 | Symptomatic | Symptom/a-symptomTic-Pertaining to | Pertaining to symptoms | 13. | 28-3 | Themal | Therm-HeatAl-Related to | Related to heat | 14. | 18-1 | Urinary | Urin-UrineAry-Pertaining to | Pertaining to urine | 15. | 18-1 | Hydration | Hyrdat-waterIon-Pertaining to | Pertaining...

Words: 665 - Pages: 3