Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!

varungoyal goyal

Ranch Hand
+ Follow
since May 31, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by varungoyal goyal

hi just read kathy ...and get preparation kit from whizlabs..no need for training...best of luck
where can i get head first java pdf if i want to buy it or any link available over www

thanks
Can some body give a possible reason for this .Thanks


Standard error from the JPOX tool + org.jpox.enhancer.JPOXEnhancer :
BUILD ERROR
The JPOX tool org.jpox.enhancer.JPOXEnhancer exited with a non-null exit
I have written one component in which I return some value which I want to display on my page. When I display this value after rendering using the first component which returns this value then this value is displayed on my page.

but when I display this value before My first component is rendered then I am not able to display this value.

My requirement is that I should display this value in both ways.

For this, I want to re-render my page from my component class , so that I can display this value on my page .

Or if there is any other solution Please suggest me
I have written one component in which I return some value which I want to display on my page. When I display this value after rendering using the first component which returns this value then this value is displayed on my page.

but when I display this value before My first component is rendered then I am not able to display this value.

My requirement is that I should display this value in both ways.

For this, I want to re-render my page from my component class , so that I can display this value on my page .

Or if there is any other solution Please suggest me
hi i am using tapestry 5 framework and when i hit the browser http://localhost:8080/start i get an exception


A runtime exception has occurred.
org.apache.tapestry.ioc.internal.util.TapestryException

Failure parsing template classpath rg/example/myapp/pages/Start.html: Element <t:actionlink> is in the Tapestry namespace, but is not a recognized Tapestry template element.
location
classpath rg/example/myapp/pages/Start.html, line 16, column 2011 <p>
12
13 <!--- <a t:type="actionlink">Start guessing</a> -->
14
15
16 <t:actionlink>Start guessing</t:actionlink>
17
18 </p>
19
20 </body>
21 </html>

org.apache.tapestry.ioc.internal.util.TapestryException

Element <t:actionlink> is in the Tapestry namespace, but is not a recognized Tapestry template element.
location
classpath rg/example/myapp/pages/Start.html, line 16, column 2011 <p>
12
13 <!--- <a t:type="actionlink">Start guessing</a> -->
14
15
16 <t:actionlink>Start guessing</t:actionlink>
17
18 </p>
19
20 </body>
21 </html>



please help as it is not recognising the t:actionlink


and ii use <a t:type="actionlink">xyz</a>
it runs well widout any exception
my class is
public abstract class SendPhotoByEmail extends ResultsPage {

private static final Logger logger = Logger.getLogger(SendPhoto.class);

@InjectObject("service hotomate.BlockUserRepository")
public abstract IBlockUserRepository getBlockUserRepository();

@InjectObject("service hotomate.messaging.EmailService")
public abstract IEmailSender getEmailService();

@InjectObject("engine-service:external")
public abstract IEngineService getExternalService();

@InjectPage("SendPhotoConfirmation")
public abstract SendPhotoConfirmation getSendPhotoConfirmationPage();

@InjectPage("ViewEmailPhoto")
public abstract ViewEmailPhoto getViewEmailPhotoPage();

@InjectPage("EnlargedView")
public abstract EnlargedView getEnlargedViewPage();

public abstract String getRecipient();

public abstract void setRecipient(String email);

public abstract String getErrorMessage();

public abstract void setErrorMessage(String errorMessage);

@Persist
public abstract long getPhotoId();

public abstract void setPhotoId(long photoId);


public IAsset getImage() {
return new ImageAsset(getRequestCycle(), new ImageSpecification(
getPhotoId(), ImageSpecification.Size.THUMBNAIL),
getImageService());
}


private String htmlEmailPage() throws SendFailedException {
try {

String uri = getExternalService().getLink(false,
externalServiceParameter()).getAbsoluteURL();
URL url = new URL(uri);
URLConnection httpUrl = url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(httpUrl.getInputStream()));
String readInString = "";
while (in.ready())
readInString += in.readLine();
in.close();
return readInString;
} catch (IOException e) {
throw new SendFailedException();
}
}

private void validateEmailAddress(String recipient) throws IllegalArgumentException {
if(recipient==null)
throw new IllegalArgumentException("> Please enter a valid email address.");
if (!recipient.matches("^([\\w\\-\\.]+)@((\\[([0-9]{1,3}\\.){3}[0-9]{1,3}\\])|(([\\w\\-]+\\.)+)([a-zA-Z]{2,4}))$")) {
throw new IllegalArgumentException("> Please enter a valid email address.");
}

}

public IPage doEnlargeView() {
getEnlargedViewPage().setPhotoId(getPhotoId());
setPreviousPageInformation(getEnlargedViewPage());
return getEnlargedViewPage();
}

private IPage confirmationPage() {
SendPhotoConfirmation page = getSendPhotoConfirmationPage();
page.setMobileNumber(getRecipient());
page.setAlbumOwnerUsername(getUsername());
setPreviousPageInformation(page);
page.setMode(1);
return page;
}

private ExternalServiceParameter externalServiceParameter() {
List parameters = new ArrayList();
parameters.add(new Long(getPhotoId()));
parameters.add(getRecipient());
parameters.add(getUser().getUsername());
ExternalServiceParameter externalServiceParameter = new ExternalServiceParameter("ViewEmailPhoto", parameters.toArray());
return externalServiceParameter;
}

public Username getOwnerUsername(){
return getUser().getUsername();
}

public boolean RecipientHasBlocked(String recipient) {
return getBlockUserRepository().contains(recipient);

}
}

###################################################33

now tell me how will i test its methods when my test class needs implementation for every abstract method in this class and ResultPage also do hav abstract methods which needs to be implemented in my test clas,,
Do you think it is feasible to write test clas like this
11 years ago
how to test a private/public methods in a abstract class. m really stuck in this ,please help
11 years ago
dude check where the private method is being called ie in which public method.....and test that public method..it easy ..try it out
11 years ago
i am using Id eclipse and to write code for tapestry i intregrated it with spindle 3.3.0 Does it indicate that i am using tapestry 3.0.
i am using Id eclipse and to write code for tapestry i intregrated it with spindle 3.3.0 Does it indicate that i am using tapestry 3.0.
My exception is

An exception has occurred.
You may continue by restarting the session.

org.apache.tapestry.ApplicationRuntimeException
Could not parse specification context:/WEB-INF/Home.page.

org.apache.tapestry.util.xml.DocumentParseException
Attribute "value" must be declared for element type "binding".

org.xml.sax.SAXParseException
Attribute "value" must be declared for element type "binding".
columnNumber: 55
lineNumber: 10
systemId: jndi:/localhost/HelloWorld/WEB-INF/Home.page
Stack Trace:
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(XMLDTDValidator.java:1306)
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1971)
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:816)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:872)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
org.apache.commons.digester.Digester.parse(Digester.java:1548)
org.apache.tapestry.parse.SpecificationParser.parse(SpecificationParser.java:642)
org.apache.tapestry.parse.SpecificationParser.parsePageSpecification(SpecificationParser.java:692)
org.apache.tapestry.engine.DefaultSpecificationSource.parseSpecification(DefaultSpecificationSource.java:161)
org.apache.tapestry.engine.DefaultSpecificationSource.getPageSpecification(DefaultSpecificationSource.java:289)
org.apache.tapestry.resolver.PageSpecificationResolver.found(PageSpecificationResolver.java:229)
org.apache.tapestry.resolver.PageSpecificationResolver.searchForPage(PageSpecificationResolver.java:148)
org.apache.tapestry.resolver.PageSpecificationResolver.resolve(PageSpecificationResolver.java:117)
org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:144)
org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:195)
org.apache.tapestry.engine.HomeService.service(HomeService.java:59)
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:889)
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:198)
org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:159)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)



My home.java is



package com.ttdev.helloworld;

import org.apache.tapestry.html.BasePage;

public class Home extends BasePage{

public String getGreetingSubject() {
return "John";
}

}



My Home.html is
<html>
hello!<span jwcid="subject">world</span>
</html>



My Home.page is

<?xml version="1.0"?>
<!DOCTYPE page-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">


<page-specification class="com.ttdev.helloworld.Home">

<component id="subject" type="Insert">
<binding name="value" value="ognl:greetingSubject"/>
</component>

</page-specification>



Please help me to get it solve
please give me the best and simple tutorial available for undertsanding tapestry framework.
i have made a simple helloworld tapestry project but i dont know how to run the application using tomcat server.please tell the procedure to integrate with tomcat.
i made an simple tapestry application without any error in html or page specification. but i am using 5.5 tomcat and ide eclipse 3.2 .when i make a hit at

http://localhost:8080/Login/app

Login is my application name
app is required to recognise for tapestry calls..as written in tutorial "http://www.sitepoint.com/print/jakarta-tapestry")

tomcat does not recognise my Login project.please help.